refactor!: carry out the simplification audit across gates, tests, plugins and docs #135

Merged
Defame1297 merged 85 commits from docs/simplification-audit into main 2026-09-20 19:14:03 +00:00
3 changed files with 22 additions and 4 deletions
Showing only changes of commit 02d5774a99 - Show all commits

View File

@@ -206,7 +206,15 @@ The shared pattern: per-skill `README.md` files no model reads, a `docs/research
>
> > **Since closed (2026-09-16, grill):** finding 18 is no longer open — it closed as not proceeding; see its own closing note.
15. **Merge `skill-author` + `agent-author` likewise.** `contract.md` shares most of its Description section; `new-skill.sh` and `new-agent.sh` implement the same package-root walk-up with different mode names; step 1 dispatch tables and step 3 gates are near-identical. Keep the agent scope logic (plugin vs project/user) as its own reference. Effort M.
15. [x] ~~**Merge `skill-author` + `agent-author` likewise.** `contract.md` shares most of its Description section; `new-skill.sh` and `new-agent.sh` implement the same package-root walk-up with different mode names; step 1 dispatch tables and step 3 gates are near-identical. Keep the agent scope logic (plugin vs project/user) as its own reference. Effort M.~~
> **Refuted (2026-09-16, at HEAD `14248e0`). The overlap is about 150–180 lines, not "most" of anything, and ADR-0020's exclusion of the pair holds on measurement.** Measured as distinct non-blank lines common to both skills, raw and then with `skill`/`agent` normalised to one token: `SKILL.md` 13–14 of 45 / 46; `references/contract.md` 36–37 of 205 / 126; `references/improve.md` 14–15 of 65 / 64; `references/create.md` 9–10 of 138 / 68; every other reference ≤12. The scripts share **48** lines (`new-skill.sh` 189, `new-agent.sh` 303, counts include blanks), mostly the package-root walk-up and its `apm.yml` `type:` matcher; the two bats suites share **15** (209 / 349). Reproduce with `comm -12 <(grep -v '^\s*$' A | sort -u) <(grep -v '^\s*$' B | sort -u) | wc -l`, run from `plugins/kyberforge/.apm/skills/` against each `skill-author/X` and `agent-author/X` pair.
>
> - **"`contract.md` shares most of its Description section" overstates it.** The shared span is the three-part shape, the banned-content list, the length gate and the boundary-target resolution rules — 36 lines against files of 205 and 126.
> - **"Step 1 dispatch tables and step 3 gates are near-identical" is true only of those two steps.** Step 2 differs completely (invocation axis vs. scope resolution), Step 3's body gate is a word budget in one and a delegation check in the other, and Step 4 bumps `metadata.version` in one and the package `apm.yml` `version` in the other.
> - **This is the opposite shape to finding 14.** There the copies were byte-identical — a 1,061-line resolver, a 526-line `vale-wrap.sh`, identical style rules — and merging removed 2,934 lines. Here the skills emit different artifacts (a skill directory vs. a one-file or two-file agent, ADR-0005 / ADR-0016), so a merge would put two unrelated scaffolds, two scripts and two test suites behind one dispatch step to save about 150 lines and one router entry.
> - **It would not retire `check-scope-walkup-sync`.** Merging takes the gate's four walk-up ports to three; the gate stays (see §10).
>
> Not proceeding. ADR-0020's rejected alternative and ADR-0025 point 7 now carry this measurement. The remaining overlap is unguarded; ADR-0020 names a text-sync gate as the only option for this pair, and 36 lines of shared Description prose do not justify one.
16. **Cut the validators by an order of magnitude.** `validate.sh` is 1,677 lines of bash with embedded Python, ported twice; `skill-size-check.sh` is 1,497. Target about 200 lines total: frontmatter present, size ceilings, boundary targets resolve. The 526-line `vale-wrap.sh` exists to work around folded `>` scalars in descriptions; writing descriptions as `|` literal blocks removes the folding problem, but the wrapper is also the exported hook entry in `.pre-commit-hooks.yaml` and carries the NOT RUN guard the audits depend on, so it shrinks rather than disappears. This is where the real complexity lives and is the item most worth discussing. Effort L.
> **Refuted (2026-09-14, at HEAD `062ca47`). Finding 16 has no independent content — its only safe saving belongs to finding 14.**
@@ -465,14 +473,16 @@ Not covered by the area audits above; found on a final sweep of the root config
## 7. Suggested order
1. Quick wins, all S, no design decisions needed: findings 9, 10, 26, 30, 31, 29, 12, 13, 1, 6, 4, 35, 37, 38, and the mirror-sync and executables-allow halves of 2. Removes roughly 25,000 to 30,000 lines and 6 hooks.
2. Structural changes that need a short discussion: ~~14~~, 15, ~~19~~, ~~20~~, ~~23~~, ~~25~~, ~~17~~, ~~3~~, ~~5~~, ~~7~~, ~~33~~, ~~34~~, ~~36~~.
2. Structural changes that need a short discussion: ~~14~~, ~~15~~, ~~19~~, ~~20~~, ~~23~~, ~~25~~, ~~17~~, ~~3~~, ~~5~~, ~~7~~, ~~33~~, ~~34~~, ~~36~~.
3. The real complexity: ~~16 (validators)~~, ~~11 (provenance)~~, ~~24 (core)~~, ~~8 and 28 (gates.md and ADRs)~~.
> **Status (2026-09-16, after the grill on 33, 28, 22/18, 20, 8, 34):** open findings were **15** (merge `skill-author` + `agent-author`) and **36** (release-tag mechanism, decision deferred by the human). **22** is deferred with the rest of `bin`. Every other finding is done, closed, or refuted at its own note.
>
> **Updated (2026-09-16, later):** **36** is decided and done (`4de5b6b`), so **15** is the only open finding. **22** stays deferred with `bin`.
>
> **Updated (2026-09-16, after the finding 15 grill):** **15** is refuted on measurement (see its note), so no finding is open. **22** stays deferred with `bin`.
> **Re-derived (2026-09-16, at HEAD):** this ordering was written before the findings were worked, and ~~seven of its entries are now closed~~ → ~~all but two~~ → all but one of its bucket-2 and bucket-3 entries are now closed (corrected later on 2026-09-16, after the grill, and again once **36** closed). Struck above: **14** landed (`467bbd7`, ADR-0025); **7** was superseded then done (`718c79a`); **3**, **5** and **19** are not proceeding on refuted premises; ~~**34**,~~ **16** and **24** are refuted outright; **34** was refuted as a removal and then decided and done as documentation of the branch hazard in ADR-0019 (`afcf477`), with the hook kept; **33** was decided and done (enforce the bump, `8451169`); **8**, **20** and **28** closed at the grill; **17**, **23** and **25** were declined by the human; **11** was declined by the human; **36** was done (`4de5b6b`). ~~**5** is left standing but is downstream of 16 by its own note, so it cannot be taken in this bucket's order.~~ **5** is closed with 16: its own note says it is downstream of 16, and 16 is refuted. Still open, per the Status note above: **15** alone, now that **36** is done (`4de5b6b`); **22** is deferred with `bin`. Read each finding's own marker, not this list — it is a plan of record, not a status board. Bucket 1 is left as written: every entry in it is marked `[x]` or carries a decision note at its own finding.
> **Re-derived (2026-09-16, at HEAD):** this ordering was written before the findings were worked, and ~~seven of its entries are now closed~~ → ~~all but two~~ → ~~all but one~~ → all of its bucket-2 and bucket-3 entries are now closed (corrected later on 2026-09-16, after the grill, and again once **36** closed and once **15** was refuted). Struck above: **14** landed (`467bbd7`, ADR-0025); **7** was superseded then done (`718c79a`); **3**, **5** and **19** are not proceeding on refuted premises; ~~**34**,~~ **16** and **24** are refuted outright; **34** was refuted as a removal and then decided and done as documentation of the branch hazard in ADR-0019 (`afcf477`), with the hook kept; **33** was decided and done (enforce the bump, `8451169`); **8**, **20** and **28** closed at the grill; **17**, **23** and **25** were declined by the human; **11** was declined by the human; **36** was done (`4de5b6b`). ~~**5** is left standing but is downstream of 16 by its own note, so it cannot be taken in this bucket's order.~~ **5** is closed with 16: its own note says it is downstream of 16, and 16 is refuted. ~~Still open, per the Status note above: **15** alone, now that **36** is done (`4de5b6b`);~~ **15** was refuted on measurement after its own grill, so none is still open; **22** is deferred with `bin`. Read each finding's own marker, not this list — it is a plan of record, not a status board. Bucket 1 is left as written: every entry in it is marked `[x]` or carries a decision note at its own finding.
Findings 9, 10, 11, and 12 are coupled through the provenance validator and the audit criteria; land them together or the audit gates start reporting the removals.
@@ -497,6 +507,7 @@ Findings 9, 10, 11, and 12 are coupled through the provenance validator and the
> **Moot (2026-09-14):** finding 24 is refuted on arithmetic before this question is reached — the three `core` bodies total 1,360 words against `BODY_MAX_WORDS=900`, and their descriptions 806 chars against a 400 cap. Nothing needs superseding because the merge it would unblock cannot be committed. Question closed unless finding 24 is rewritten.
>
> **Closed (2026-09-16):** both halves are settled — finding 14 landed and finding 24 is refuted. The only finding left under this bullet is 15, which needs no ADR-0012 revisit (see above); its remaining question is the design one this bullet already names.
> **Closed (2026-09-16, later):** finding 15 is refuted on measurement — about 150–180 shared lines, and ADR-0020's exclusion holds. See its note in §4.2. Nothing remains open under this bullet.
- [x] ~~**Granularity of git/gitea skills.** One `git` skill vs seven trades routing precision for size. Is one broad description acceptable?~~
> **Answered by measurement (2026-09-14): no, and it is not a preference question.** A merged git description measures **1,950 chars against a 400-char FAIL ceiling (4.9×)** and a 3,381-word body against 900 (3.8×). Both proposed gitea halves also FAIL at 2.5×, and the gitea split additionally puts a hard boundary through the edit-a-file-then-open-a-PR workflow. (An earlier revision also called the gitea split "blocked by ADR-0011, which already rejected a *smaller* bundling" — withdrawn; ADR-0011's objection is to a boundary being crossed, not to bundle size. See finding 20's verification note.)
>

View File

@@ -535,6 +535,10 @@ Upstream citations below are relative to
Largest cut available. Rejected because it reopens ADR-0005, ADR-0008 and ADR-0016 together, and a
merged author skill would carry both the skill-directory scaffold and the dual-provider agent
scaffold behind one dispatch.
**Measured (2026-09-16):** the pair shares about 150–180 distinct non-blank lines — 36 in
`contract.md` (of 205 / 126), 13 in `SKILL.md`, 14 in `improve.md`, 48 in the two scaffold
scripts — against the 2,934 that the audit-pair merge removed. The rejection holds; simplification
audit finding 15 is refuted on this basis.
- **Demoting Gotchas** to the end of the body or into `references/gotchas.md`, removing its
position-based exemption from the dispatch rule. Maximum saving on the largest body construct
(6,830 words, 21% of all body text). Rejected because a gotcha read after the mistake is worthless.

View File

@@ -219,8 +219,11 @@ never *parsed* differently. What the gate never covered was the prose around the
docstring there asserted identity the loop did not have. One sourced library removes the question.
**7. Two things this change does not do.** `skill-author` and `agent-author` are **not** merged
here. That remains an open finding and it is unmeasured; ADR-0020 excluded the pair on the grounds
here. ADR-0020 excluded the pair on the grounds
that they emit genuinely different artifacts, and nothing measured in this session revisits that.
*(Updated 2026-09-16.)* It was an open, unmeasured finding when this was written; it has since been
measured at about 150–180 shared lines and refuted, and ADR-0020's rejected alternative records the
figures.
And **no audit criterion changes.** Every check, tier, threshold, regex and branch is carried across
as-is. The Python payloads reassembled from the new libraries differ from the pre-merge heredocs only
in comments. The one exception is three lines naming `references/agent-field-inventory.md`, a