Skip to content

Commit 04c4aa7

Browse files
fix: resolve docs audit residuals R.1–R.3 and retire audit (#124)
Closes May 2026 docs fact-check audit R.1–R.3. Adds MCP files/symbols resources, state-dir recipe resolution, function_params.owner_kind, docs/plans sweep, and dependency updates.
1 parent 14d3efc commit 04c4aa7

64 files changed

Lines changed: 1729 additions & 269 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.agents/lessons.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
# Lessons
22

3-
Persistent log of corrections and insights from past sessions. Agents **must** check this file at the start of every session and append new lessons after corrections.
3+
Persistent log of corrections and insights from past sessions. Read when relevant; **encode durable lessons in rules/skills** this file is a staging area, not an archive.
44

5-
## Format
5+
## Rules
66

7-
Each entry is a single bullet: `- **<topic>** — <lesson>`. Newest entries at the bottom.
7+
1. **Append only durable, non-obvious corrections** — not session trivia already captured in a rule, skill, or reference doc.
8+
2. **Prefer lifting** — when a lesson becomes policy, move it to `.agents/rules/` or the relevant skill and **delete** the bullet here (or supersede with one line pointing at the rule).
9+
3. **Keep entries atomic** — one lesson per bullet. One sentence.
10+
4. **No duplicates** — check before appending; merge or supersede instead.
11+
5. **Supersede, don't accumulate** — outdated lesson → replace with a new bullet citing what changed; don't leave both.
812

913
## Lessons
1014

.agents/rules/agents-tier-system.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Genuinely cross-cutting. Apply to every turn regardless of file:
2828
- `codemap` — STOP-before-grep
2929
- `concise-comments` — sweep your own new comments before reporting
3030
- `concise-reporting` — extreme concision in agent reports
31-
- `lessons` — read at session start, append after corrections
31+
- `lessons` — read when relevant; lift durable ones into rules/skills
3232
- `no-bypass-hooks` — never `--no-verify` on `git commit`
3333
- `pr-comment-fact-check` — fires the fact-check skill on PR-comment intent triggers
3434
- `preserve-comments` — never silently delete TODOs / commented-out code
@@ -45,7 +45,7 @@ Today's Tier-2 rules:
4545

4646
- `agents-tier-system` (this rule) — auto-attaches when authoring under `.agents/**` or `.cursor/**`.
4747
- `docs-governance` — primes the docs framework when authoring under `docs/**` or `.agents/**` (paired with [`docs-governance` skill](../skills/docs-governance/SKILL.md)).
48-
- `plan-pr-inspiration-discipline` — primes plan-PR / recipe authoring with the open-spec inspection list when authoring under `docs/plans/**` or `templates/recipes/**`. The canonical inspection-sources table lives in the rule body itself (lifted from `research/non-goals-reassessment-2026-05.md § 4` in 2026-05; see [§ 7 Lifted to](../../docs/research/non-goals-reassessment-2026-05.md#7-lifted-to)).
48+
- `plan-pr-inspiration-discipline` — primes plan-PR / recipe authoring with the open-spec inspection list when authoring under `docs/plans/**` or `templates/recipes/**`. The canonical inspection-sources table lives in the rule body itself.
4949

5050
### Tier 3 — Discoverable skills (no rule)
5151

.agents/rules/docs-governance.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,28 +21,28 @@ The canonical Rules (1–10) live in [`docs/README.md`](../../docs/README.md)
2121

2222
## Five lifecycle types (universal)
2323

24-
| Type | Folder | Closing |
25-
| ------------- | ----------------------------------------------------- | ------------------------------------------------------------------- |
26-
| **Reference** | root (`architecture.md`, `glossary.md`, etc.) | Lives forever; kept current |
27-
| **Roadmap** | root (`roadmap.md`, single file) | Lives forever |
28-
| **Plan** | `plans/<name>.md` | **Delete + lift** when work ships (no "Slim & keep in plans/") |
29-
| **Audit** | `audit.md` (single) OR `audits/<topic>.md` (multi) | Substrate variants — see skill |
30-
| **Research** | `research/<tool>.md` OR `research/<topic>-YYYY-MM.md` | Adopted (lift + delete) / Rejected (keep with status header) / Open |
24+
| Type | Folder | Closing |
25+
| ------------- | ----------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- |
26+
| **Reference** | root (`architecture.md`, `glossary.md`, etc.) | Lives forever; kept current |
27+
| **Roadmap** | root (`roadmap.md`, single file) | Lives forever |
28+
| **Plan** | `plans/<name>.md` | **Delete + lift** when work ships (no "Slim & keep in plans/") |
29+
| **Audit** | `audit.md` (single) OR `audits/<topic>.md` (multi) | Substrate variants — see skill |
30+
| **Research** | `research/<tool>.md` OR `research/<topic>-YYYY-MM.md` | Adopted lift + **delete** (unless inbound cites require slim stub) / Rejected status header only / Open |
3131

3232
## Top three disciplines
3333

3434
1. **Anchor preservation** — slim READMEs keep cited rule numbers and section anchors. Grep before any slim: `rg "Rule [0-9]+" docs/` and `rg "<doc-path>(#[a-z-]+)?"`.
3535
2. **Anti-bloat meta-rule** — don't add a rule until there's content that needs it. Same for ownership-table rows.
36-
3. **Repo-level vs in-source** — repo-wide tool evaluations + adoption (oxlint, future plugins) live in `.agents/`, not as permanent `docs/research/` files. A `docs/research/` file may motivate the adoption, but the rule + skill earn the permanent home. Per-tool tracker notes (peer-tool comparisons, adoption-candidate logs) are an anti-pattern — peer-tool framing goes off-mission fast; positioning lives in [`docs/why-codemap.md`](../../docs/why-codemap.md) and [`research/non-goals-reassessment-2026-05.md`](../../docs/research/non-goals-reassessment-2026-05.md), not in tracker files.
36+
3. **Repo-level vs in-source** — repo-wide tool evaluations + adoption (oxlint, future plugins) live in `.agents/`, not as permanent `docs/research/` files. A `docs/research/` file may motivate the adoption, but the rule + skill earn the permanent home. Per-tool tracker notes (peer-tool comparisons, adoption-candidate logs) are an anti-pattern — peer-tool framing goes off-mission fast; positioning lives in [`docs/why-codemap.md`](../../docs/why-codemap.md), not in tracker files.
3737

3838
## Existence test (apply on every doc-touching PR)
3939

4040
A file earns its place if it meets at least one of:
4141

4242
1. Source code cites it (JSDoc, error message, comment grep-anchor)
4343
2. It documents durable policy unavailable elsewhere
44-
3. It tracks open work (audit findings, plan, roadmap items, evaluation)
45-
4. It carries unique historical context that `git log` + reference docs can't reconstruct
44+
3. It tracks open work (audit findings, in-flight plan, roadmap items, evaluation with unresolved items)
45+
4. Inbound source cites require a slim stub — deletion would orphan a live citation (not "interesting history")
4646

4747
If none → fold + delete.
4848

.agents/rules/lessons.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
---
2-
description: Read lessons at session start; append after corrections
2+
description: Read lessons when relevant; lift durable ones into rules/skills
33
alwaysApply: true
44
---
55

66
# Lessons Convention
77

88
## Rules
99

10-
1. **Read at session start** — At the beginning of every conversation, read `.agents/lessons.md` to avoid repeating past mistakes.
11-
2. **Append after corrections** — When the user corrects you or you discover a non-obvious mistake, append a bullet to the `## Lessons` section: `- **<topic>** — <lesson>`.
12-
3. **Keep entries atomic** — One lesson per bullet. Be concise (one sentence).
13-
4. **No duplicates** — Before appending, check if an equivalent lesson already exists.
14-
5. **Never delete lessons** — Only add. If a lesson becomes outdated, append a new one that supersedes it.
10+
1. **Read when relevant** — skim `.agents/lessons.md` when the task touches an area with past corrections; not a mandatory full read every session.
11+
2. **Append only durable, non-obvious corrections** — not session trivia already in a rule, skill, or reference doc.
12+
3. **Prefer lifting** — when a lesson becomes policy, move it to `.agents/rules/` or the relevant skill and remove the bullet here (or supersede with one line pointing at the rule).
13+
4. **Keep entries atomic** — one lesson per bullet. One sentence.
14+
5. **No duplicates** — merge or supersede instead of appending near-duplicates.
15+
6. **Supersede, don't accumulate** — outdated lesson → one replacement bullet; don't leave both.

.agents/skills/audit-pr-architecture/SKILL.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -196,10 +196,10 @@ This audit follows [docs/README.md Rule 6](../../../docs/README.md) (no inventor
196196

197197
Once findings are shipped (or deferred to `roadmap.md`):
198198

199-
1. **Update Status header**: `Status: Closed (YYYY-MM-DD) — N findings shipped on commits <hash>, <hash>, <hash>; M deferred to roadmap.md § <section>.`
200-
2. **Add to `roadmap.md` § Closed audits (pointers)** with a one-line summary.
201-
3. **Apply [`docs-governance`](../docs-governance/SKILL.md) § Closing an audit re-derivable test.** If the audit has no source-cites, no unique policy, no rejected-alternatives rationale → digest deferred items into `roadmap.md`, then **delete the audit file** (no tombstones). Otherwise slim per the keep-criteria.
202-
4. **Run [`docs-lifecycle-sweep`](../docs-lifecycle-sweep/SKILL.md)** if the closure changes the audit substrate (new topic file, retired old topic) so the rest of the audits/ folder stays evaluated.
199+
1. **Update Status header** (only if the file stays): `Status: Closed (YYYY-MM-DD) — N findings shipped; M deferred to roadmap.md § <section>.` Prefer the closure PR as the durable anchor — not a growing commit-hash list in the doc body.
200+
2. **If the audit file is deleted**, cite the shipping PR in the closure PR description — do not add tombstone rows or deleted-path recovery instructions in living docs (see [`docs/README.md` § Closing audits](../../../docs/README.md#closing-audits)).
201+
3. **Apply [`docs-governance`](../docs-governance/SKILL.md) § Closing an audit re-derivable test.** If the audit has no source-cites, no unique policy, no rejected-alternatives rationale → digest deferred items into `roadmap.md`, then **delete the audit file** (no tombstones). Otherwise slim to cited sections only — not full findings prose.
202+
4. **Run [`docs-lifecycle-sweep`](../docs-lifecycle-sweep/SKILL.md)** only when closure leaves other files in `docs/audits/` or `docs/research/` that fail the existence test — not as a mandatory post-step on every closure.
203203

204204
## Anti-patterns
205205

.agents/skills/diagnose/SKILL.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,6 @@ Required before declaring done:
111111
- [ ] All `[DEBUG-…]` instrumentation removed (`grep` the prefix)
112112
- [ ] Throwaway prototypes deleted (or moved to a clearly-marked debug location)
113113
- [ ] The hypothesis that turned out correct is stated in the commit / PR message — so the next debugger learns
114-
- [ ] If the post-mortem yields a permanent insight, append a one-line entry to [`.agents/lessons.md`](../../lessons.md) per the lessons-rule discipline
114+
- [ ] If the post-mortem yields a permanent insight, **lift** it into `.agents/rules/` or the relevant skill; append to [`.agents/lessons.md`](../../lessons.md) only when it is not yet encoded elsewhere
115115

116116
**Then ask: what would have prevented this bug?** If the answer involves architectural change (no good test seam, tangled callers, hidden coupling) hand off to [`improve-codebase-architecture`](../improve-codebase-architecture/SKILL.md) with the specifics. Make the recommendation **after** the fix is in, not before — you have more information now than when you started.

0 commit comments

Comments
 (0)