Loading...
Loading...
Capture each agent failure, bucket and count it deterministically, and when a failure class recurs past a threshold, scaffold a candidate rule/skill stub into the propose->gate flow so the same mistake becomes a guardrail instead of repeating. Hamel's create->label->fix->repeat flywheel, self-evolving. Trigger when the user says "log this failure", "record the mistake", "why does this keep happening", "turn failures into rules", "failure taxonomy", "what keeps breaking", or invokes /failure-flywheel. Also run --report periodically to see the top recurring failure classes.
npx skill4agent add rheinmir/setup failure-flywheel--report--draft <category>/propose/failure-flywheel/proposefailure → record(category) → failures.jsonl → --report (group · COUNT · leaderboard) → lớp ≥ recurrence_threshold → --draft stub → /propose → cổng người duyệt| Field | Required? | Ý nghĩa | |
|---|---|---|---|
| In | | có (record) | lớp taxonomy gần nhất; category lạ vẫn ghi, bị gắn cờ ở report |
| In | | không | chi tiết thêm |
| In | | không (draft) | ISO only, mặc định 2026-06-29; sai định dạng → exit 2 |
| In | | có | ngưỡng + taxonomy (adapter, |
| Out | dòng trong failures.jsonl | có (record) | lịch sử local, gitignored |
| Out | leaderboard | có (report) | đếm theo lớp, first/last seen, lớp nào |
| Out | | chỉ khi đủ ngưỡng | STUB (OKF frontmatter + |
--draft/propose--dateYYYY-MM-DDDDMMYY--date--draft--dateverified: false| Step | Type | Inputs | Action | Outputs/exit | Failure/next |
|---|---|---|---|---|---|
| W01 | effect | failure vừa xảy ra | | dòng jsonl | category lạ → vẫn ghi + cờ ở report |
| W02 | deterministic | failures.jsonl + config | | lớp đánh dấu | không lớp nào đủ → dừng |
| W03 | effect | lớp đủ ngưỡng | | file draft stub | chưa đủ ngưỡng / |
| W04 | judgment | stub | STOP chờ người; người chạy | proposal đầy đủ | người từ chối → giữ stub |
# 1. CAPTURE — append one failure (BY CODE; failures.jsonl is gitignored local history)
python3 harness/scripts/failure-flywheel.py record <category> "<summary>" [--detail "..."]
# 2. REPORT — deterministic taxonomy: group by category, COUNT, leaderboard (most-frequent
# first) + first/last seen + which classes are eligible to draft
python3 harness/scripts/failure-flywheel.py --report
# 3. DRAFT — only if <category> recurs >= recurrence_threshold: scaffold a STUB proposal at
# llmwiki/wiki/sources/draft/DDMMYY-failure-<category>.md and STOP for human approval
python3 harness/scripts/failure-flywheel.py --draft <category> [--date YYYY-MM-DD]record--report--reportDRAFT--draft <category>## Origin## Plan/proposerecurrence_thresholdrecord()harness/metrics/guardrails/failure-<lớp>.md # máy gói, có INDEX.md; được commit để phiên/máy khác cùng học
python3 harness/scripts/flywheel.py --kind failure --guardrails # gói lại toàn bộ lớp đã đủ ngưỡngsession_start🧯 [đã học]đã học, CHƯA duyệt--draft/proposeharness/failure-flywheel.config.yamlverified: false--draftverified: true| ID | Kind | Guard | Hành vi | Skip / failure | Rejoin |
|---|---|---|---|---|---|
| B01 | conditional_required | lớp lỗi ≥ | W03 | dưới ngưỡng → skip, chỉ report | W04 |
| B02 | capability_optional | config | stub có rule tự chưng cất thay vì human-TODO | chưa verified → human-TODO stub (mặc định hiện tại) | W04 |
failure-flywheel.py## Origin## Planpython3 harness/scripts/failure-flywheel.py record invented-api "called nonexistent fetchAll()"--reportinvented-apiDRAFT--draft invented-apillmwiki/wiki/sources/draft/DDMMYY-failure-invented-api.md/propose--draft invented-api --date 19/09/2026harness/scripts/code-logger.pyllmwiki/skills/dev-loop/propose.mdllmwiki/skills/dev-loop/build-now-adapt-later.md