c07ca0767e2e64537119cc3eeea88dbb7c163752
23
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
89b1c6fc85 |
docs: record the grill and declined-finding decisions in the audit
Findings 11, 17, 23, 25 and 27 are declined. From the grill: 33 and 34 done, 8, 18, 20 and 28 closed, 22 deferred with bin. Open: 15 and 36. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> |
||
|
|
69119f4754 |
docs: reconcile the ADRs, gates and audit log with the shipped behaviour
Why A six-agent review of the two preceding commits found their code sound -- the differential claim holds, the published hook contract is byte-unchanged -- but their prose drifted from it in three ways: statements of fact the code contradicts, markers in a convention this repo does not use, and figures that went stale when the merge changed what they counted. Implementation Notes ADR-0025's edge-path table is rewritten around one stated doctrine: exit 0 is audited and clean, exit 1 is audited with findings or a target present but unreadable, exit 2 is that nothing was audited. Its old row 1 promised "one generic matches-neither message" for three different inputs; there are three distinct messages, and the missing-path case exited 1 until the preceding commit fixed it. Rows are added for the preflight and CDPATH changes, because a table claiming to enumerate every entry-point behaviour change reproduces its own "an earlier revision of this ADR said they were behaviour-neutral" failure if it omits any. ADR-0025 also gains a Consequences supersession record in ADR-0016's form: partially-superseded entries for 0008, 0014, 0020 and 0021, and explicit "is not superseded" entries with reasoning for the rest. Twelve ADRs are amended and it previously listed none. ADR-0008 moves from an amendment note to partially superseded. Its contract genuinely narrowed -- an agent .md outside an agents/ directory was audited before the merge and is refused now -- and ADR-0020 already recorded that the merge "reopens ADR-0008". Its detector description said "a path under .apm/agents/", the phrasing ADR-0025 rejects as wider than the script and circular; the shipped rule is a .md whose immediate parent is named agents/, at any scope. ADR-0020's amendment claimed the boundary resolver is sourced by validate-provenance.sh. It is not, and never was; only validate.sh sources it, once per mode branch. Three Home-column entries pointed at reference filenames the merge renamed, one of which now resolves to two files because its row covers skills and agents. Five ADRs opened with "Skill renamed per ADR-0025", a form this repo does not use, in the same commit that used the conventional "Amended by ADR-0025" twice. They are normalized. "Renamed" was also wrong: the BREAKING-CHANGE trailer says the skills were removed and their flows merged. SIMPLIFICATION-AUDIT.md had 2026-09-15 notes attached to headlines that were never updated, against its own convention of correcting in place with strikethrough. Every figure here was re-derived at HEAD by command, and several differed from the review's own numbers, so the notes record the basis rather than the result alone. LESSONS.md asserted the two review-time suite failures were the SIGPIPE race. The commit that fixed that race explicitly declined to claim it -- the suite was running while agents edited live config files -- so the hedge is restored. Impact No code, test or configuration change; documentation only. Suites stay 20/20 strict with 0 skipped and 374/374 bats. No gate parses ADR or gates.md content, so nothing here is load-bearing for a hook. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01YR2CjVumUbEGWcMikcoXBD |
||
|
|
ffcbed6c41 |
fix(tests): replace pipefail-racy echo | grep -q with here-strings
Why Two suites failed intermittently — tests/test-vale-wrap.sh case 21 and tests/test-check-release-needed.sh cases 4 and 15 — on correct output, and never when run alone. The cause is the `echo "$OUT" | grep -q P` idiom under `set -o pipefail`: grep -q exits as soon as it has an answer, bash's echo can hand a multi-line value to the pipe one line at a time, and a write after the reader is gone kills echo with SIGPIPE. pipefail then reports the writer's death, so output that DID match reads as "no match". Every observed failure had lines after its match; case 15's match is on line 1 of 6, the widest window in that file. Forced with a pause before the writer's last line, the pipe form failed 50 of 50 runs; a here-string, a match on the last line, and the same pipe without pipefail each passed 50 of 50. Unforced the rate is about 1 per 670 suite runs, which is why it read as a flaky gate rather than a bug. The failures at review time are consistent with this, but were not proven to be it: the suite was running while agents edited live config files in place, and a brief change to .vale.ini or .pre-commit-hooks.yaml would produce the same two failures. The race is real and fixed either way. Implementation Notes `grep -q P <<< "$VAR"` has no separate writer process, so there is nothing to race. It is not a retry or a sleep. 121 sites converted across 9 files, three of them scripts rather than tests: new-agent.sh, new-skill.sh and check-executables-allow-sync.sh. None ships via .pre-commit-hooks.yaml, so no external consumer pins them, and all three are single-pipeline checks whose verdict cannot change. Left alone deliberately: 14 sites whose writer is a command, not a shell builtin — they either absorb the writer's status with `|| true` or are python3 and awk, which write once at exit — and one file with no pipefail. `printf '%s'` sites differ from a here-string only by a trailing newline, which no -q verdict on a non-empty pattern depends on. tests/test-no-pipefail-early-exit-grep.sh is a static guard against new occurrences, discovered automatically by run-tests.sh. It only scans files that set pipefail, joins continuation lines, skips comments, and flags only echo/printf writers. Its first case proves the scanner can fail before its second trusts a clean verdict on the tree. A guard covers exactly the spellings its regex models, so the miss surface was measured rather than assumed. Four were found and closed: pipefail declared as `set -o errexit -o pipefail` (where the old pattern required pipefail to follow the FIRST -o, and a file-level miss skips every site in that file); a writer separated from grep by an intermediate stage; a pipeline wrapped on a trailing `|` rather than a backslash; and readers spelled egrep, fgrep, /bin/grep, `command grep` or with an env-var prefix. Segment characters exclude a bare `&` so `echo ok && other | grep -q x`, whose writer is `other`, does not false-fire. Widening surfaced 5 live sites invisible to the original scanner, all in tests/test-apm-current-hook.sh, all `echo "$out" | json_field ... | grep -q`; they are safe today only because json_field is python3, which reads to EOF and writes once. Fixtures go 4 to 12 vulnerable spellings plus near-miss negatives. Two `grep ... | head -1` sites (test-vale-wrap.sh) are the same race with a different early-exiting reader, and are fixed by absorbing the writer. The scanner deliberately does not model `head`, `sed -n 1p` or a bare `read`: most legitimate uses in this tree are already absorbed with `|| true` and the scanner cannot see absorption from pipeline text, so a high false-positive rate would be how this guard gets weakened. Heredoc bodies are scanned as code; none in the tree trips it today. Impact The bug predates the factory-audit merge: every converted site in check-release-needed and case 21 dates to |
||
|
|
620f20b0fd |
refactor(kyberforge)!: merge skill-audit and agent-audit into factory-audit
Why The two audit skills carried 1,724 lines of byte-identical duplication: the ADR-0020 boundary resolver (1,061), vale-wrap.sh (526), the Vale style rules (44) and the Contributing-files parser (93). Nothing shared them — they were held in sync by a 413-line pre-push gate and its 797-line test suite. Sync-by-gate had already failed once: at |
||
|
|
a5962ba773 |
fix: point the HUMANS.md counterpart references at the file that exists
Why: three governance documents cited `docs/HUMANS.md`, which has never existed -- the human practitioner rules live at `docs/wiki/HUMANS.md`. One of the three is `core/instructions/governance.md`, which is `@`-imported into every session in every project, so an agent following its "read it when making decisions not covered here" pointer hit a dead path. That file was self-inconsistent: line 73 already cited the correct path while line 82 did not. Implementation notes: five occurrences corrected across three files -- `core/instructions/governance.md:82`, `docs/research/governance_principles/CONTROLS.md:5,101,106`, and `docs/ai-constitution.md:238`. Text is otherwise untouched; this is a path correction only, not a change to any governance rule. Marked the defect fixed in SIMPLIFICATION-AUDIT.md, which recorded it in two places as outstanding. Impact: no rule, gate or behaviour changes. The deployed copy at `~/.claude/core/instructions/governance.md` no longer matches the repo and stays stale until `scripts/install.sh` re-runs; it was byte-identical before this commit. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01YR2CjVumUbEGWcMikcoXBD |
||
|
|
64d3fd8427 |
docs: record findings 5, 18, 32 and the ten-finding verification wave
Why: this audit was written read-only and its scope estimates proved systematically optimistic. Ten open findings with claimed yield were re-verified against the files by independent agents. One premise of ten survived, and the headline figure was wrong in at most eight of the ten. Implementation notes: per-finding verification notes on 11, 16, 20, 22, 24, 27, 28, 33, 34 and 36. Finding 5 marked not proceeding, on the same grounds as finding 3 -- its six suites are split by failure class, not ADR section, and five of the six headers name the incident they guard. Finding 18 re-scoped and folded into finding 22 under three exemptions (audit criteria, assets/templates and sourced spec restatement, the last now carrying a decidable test rather than resting on the presence of source_keys). Finding 32 closed with its premise corrected. Section 8 questions updated where measurement answered them: ADR-0012 is moot, git/gitea granularity fails an enforced gate at 4.9x, and the external-consumer question has its evidence but awaits a decision. New section 10 records the wave, the recurring failure mode behind six wrong findings, and where the remaining opportunity actually sits. The wave's own notes were then re-verified by a second independent round, and this commit carries those corrections. The notes had an error rate comparable to the findings they corrected. Four errors changed a verdict. Finding 11's note anchored its search at column 0 and so missed every source_keys carrier nested under metadata:, producing "172 carriers" (196), "zero of 40 SKILL.md files carry source_keys" (28 of 39) and "check 2 is dead code" (live, with bats coverage); its double-counting accusation was a misreading of the word "plus" and is withdrawn. Finding 28's note claimed 2,740 lines "has never matched any commit" -- it is exact at |
||
|
|
062ca47a18 |
docs: correct claims left stale by today's apm-only commits
A five-agent review of today's seven commits found no executable
regressions and no dangling references, but a set of documents still
asserting, in present tense, machinery that ADR-0024 and its commits
removed. This corrects them in place, keeping the original text as the
historical record wherever the repo's amendment convention applies.
LESSONS.md: the 2026-06-21 entry prescribed a `claude plugin validate`
sweep that now fails on every plugin, so it is marked superseded with
the surviving gates named. The 2026-08-09 entry gained a recurrence
note: today's manifest deletion broke apm's MCP propagation exactly as
that lesson describes, and its prescribed repo-local grep could not
have caught it, because `plugin_parser.py` ships in the apm toolchain
installed outside this repository.
ADR-0019, ADR-0011 and ADR-0021: amendments extended to passages the
earlier correction passes stepped over -- a dead native-consumer guard,
Consequences bullets still calling for a `plugins/gitea/.mcp.json` that
must not be recreated, and a drift-gate list naming a deleted script.
ADR-0021's list is down to one gate, not two: `apm audit --ci` never
read `description` and was never a drift gate.
architecture.md and enrichments.md: the self-containment constraint is
restated on its live source, the agentskills.io APM package-mode spec,
rather than on Claude Code's plugin cache-install, which ADR-0024
consequence 6 pins as a superseded rationale. releasing.md's pointer to
the deleted sync script is rewritten as history.
tests/run-bats.sh and scripts/lib/batch-run.sh: comment-only. The
`.claude/skills/` exclusion comment claimed a duplication that is not
live yet; apm does not strip `tests/`, and the deployed tree is empty
of them only because the lockfile still resolves the six dependencies
to a pre-ADR-0024 commit carrying the flat mirror. The exclusion is
correct but forward-looking, and now says so.
SIMPLIFICATION-AUDIT.md: reconciled against what the commits actually
did. Two closed findings recorded conclusions that ADR-0024 reversed
hours later; findings 1, 3, 31 and 35 carried prescriptions voided the
same day; finding 28 is now recorded as having moved backwards, with
docs/adr/ measured at +336 lines over the day. The section 1 headline
table is re-measured at
|
||
|
|
a6434e0cdb |
docs: amend ADR-0021 and close the loose ends ADR-0024 left behind
A six-agent review of today's commits found three documentation defects that the apm-only change left behind. All three are records that describe deleted machinery in the present tense; no code or gate is affected. ADR-0021 was the one ADR that ADR-0024 invalidates without carrying an amendment note -- 0001, 0006, 0011, 0013, 0014, 0015, 0017, 0018 and 0019 all got one. Its Context section still compiles a plugin description into four generated files and its Consequences section still names eight, but |
||
|
|
061bb3d5b4 |
docs: correct the apm-only change after a five-agent review
A five-agent review of |
||
|
|
d2480b8191 |
docs: record the apm-only decision and its carried-forward consequences
Marks §8's install-path question answered and finding 7 superseded-then-done (deleted rather than shrunk, since the mirror it guarded is gone). Corrects two stale figures: the mirror was 213 files / 20,061 lines, not 263 / ~22,000, and the pre-push stage now reports 11 hooks, not 14. Adds §9 for what the decision carries forward rather than resolves: the two accepted residuals, the self-containment negative result (findings 14/15 still need skill merges, not file sharing), and the now-unreported symlink drop. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01YR2CjVumUbEGWcMikcoXBD |
||
|
|
0dffff3c21 |
chore: drop redundant apm-marketplace-check and Copilot marketplace mirror (findings 1, 2)
apm-marketplace-check checked network reachability of remote marketplace refs, but finding 35 already removed the only remote package entry, so every marketplace.packages[] source is local and the hook is pure overlap with apm-pack-check-clean. apm-audit-ci was re-examined and kept as-is -- its pre-commit-config.yaml comment already carries a dated, verified justification the audit had missed. check-marketplace-mirror-sync guarded .github/plugin/marketplace.json against drift from .claude-plugin/marketplace.json. Verified against current GitHub Copilot CLI docs: Copilot's marketplace discovery already falls back through .github/plugin/marketplace.json to .claude-plugin/marketplace.json, which this repo generates anyway -- the dedicated mirror bought a discovery-order preference, not a capability. Deleted the mirror file, its sync script, its test, and the hook. Co-Authored-By: Claude Sonnet 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01YR2CjVumUbEGWcMikcoXBD |
||
|
|
afa7187d33 |
docs: dedupe .apm/-mirror and apm.lock/SessionStart restatements (finding 29)
README and AGENTS.md each fully restated the "edit .apm/, never the mirror" rule and the apm.lock/SessionStart mechanism instead of linking to their canonical sources (architecture.md, ADR-0019). Co-Authored-By: Claude Sonnet 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01YR2CjVumUbEGWcMikcoXBD |
||
|
|
e2e957efdd |
docs: record subagent outcomes for findings 2, 31, 38
Three findings from the simplification audit were independently re-verified before execution, corrected, then implemented by subagents: - Finding 2 (check-executables-allow-sync): the audit's "drop it" option was found unsafe (ADR-0019 calls this failure mode silent, not "visible and recoverable" as claimed); shrunk instead of deleted, 231 -> 222 lines. - Finding 31 (CONTEXT.md): "most terms unused by skills" was found overstated (13 of 28 are model-facing must-keeps); cut only the 9 confirmed true orphans, 28 -> 19 terms. Also de-referenced one dangling pointer to a deleted term in the Flagged-ambiguities section. - Finding 38 (pc-author/pc-run): line count was found overstated (598 actual vs. 689 claimed); trimmed the two generic reference files by 60 lines while preserving house-specific content. Co-Authored-By: Claude Sonnet 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01YR2CjVumUbEGWcMikcoXBD |
||
|
|
14f327409e |
docs: record subagent outcomes for findings 3, 8, 19, 35, 37
Two landed (8 partial, 35 in full); three declined after investigation found the audit's premise didn't hold on inspection of current code. Co-Authored-By: Claude Sonnet 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01YR2CjVumUbEGWcMikcoXBD |
||
|
|
cc2553d5f6 |
docs: fix two more stale commit hashes in simplification audit
Findings 13 and 21 cited b4c3d5e and 4bbd8a5, both dangling (not reachable from HEAD) -- an amend after |
||
|
|
ace2d66343 |
docs: fix stale commit hashes in simplification audit
The Done blockquotes for findings 1, 4, and 6 cited a pre-amend hash of their own commit (a commit can't know its final hash before it's made). Point them at the actual final hashes: |
||
|
|
5f9f2b33b0 |
chore: delete prose-grep governance/instructions tests
test-governance-layer.sh and test-instructions-and-docs.sh (583 lines combined) grep markdown files for expected phrases, including a one-shot "issue 0015 refactor incomplete" assertion made permanent and an assertion that docs/notes/ exists. Neither is referenced by any other script or doc. check-apm-agents-valid.sh is left untouched — it is tied to the separate, out-of-scope skill-merge finding 14. Co-Authored-By: Claude Sonnet 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01YR2CjVumUbEGWcMikcoXBD |
||
|
|
c8a7c9ea87 |
chore: fold skill-frontmatter into skill-size-check
skill-frontmatter was a 62-line bash script inlined in .pre-commit-config.yaml, re-parsing SKILL.md frontmatter with grep and awk to check for name/description/metadata.version fields. skill-size-check.sh already parses the same frontmatter block with PyYAML for its ADR-0020 checks, so the two checks belonged in one script. Adds a ~20-line required-frontmatter check (name, description, metadata.version as three-part semver) to scripts/skill-size-check.sh. Removes the inline skill-frontmatter hook from .pre-commit-config.yaml and deletes tests/test-skill-frontmatter.sh (366 lines). Removes the 79-line "the other hook on that scope" discussion from docs/spec/gates.md and its now-dangling cross-reference, replacing both with a one-line note of the fold, and updates the pre-push hook counts there. Updates fixture builders in test-skill-size-check.sh, test-adr0020-body-checks.sh, test-adr0020-targets.sh, test-adr0020-differential.sh, and test-vale-hooks-consumer.sh to carry valid metadata.version so the new check doesn't spuriously fail existing fixtures that predate it. Co-Authored-By: Claude Sonnet 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01YR2CjVumUbEGWcMikcoXBD |
||
|
|
e647f14535 |
chore: delete the check-manifests pre-commit hook
Six pre-push hooks were validating overlapping sets of the same manifests. check-manifests (marketplace.json/plugin.json path checks) is redundant with validate-plugins (claude plugin validate) and apm-pack-check-clean, which already cover the same ground. Deletes the check-manifests hook entry, scripts/check-manifests.sh (282 lines), and tests/test-check-manifests.sh (771 lines). scripts/lib/marketplace-plugins.sh is kept — it is still sourced by sync-plugin-content.sh. Updates the now-stale check-manifests.sh mentions and hook counts in README.md and docs/spec/gates.md. The apm-audit-ci and apm-marketplace-check hooks named in the same finding are left untouched — the audit flags them as needing a separate decision. Co-Authored-By: Claude Sonnet 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01YR2CjVumUbEGWcMikcoXBD |
||
|
|
6cfc3577e2 |
docs: trim repeated boilerplate in git, gitea, and bin skills
Finding 13: five blocks of near-identical wording were repeated across skills within a plugin — the gitea "resolve owner and repo" step (5 skills), the 404-masks-403 note (6 files), the manual pagination explanation (8 files), the git plugin's main/master force-push refusal (7 files, some with multiple internal restatements), and the bin skills' domain-glossary/ADR paragraph (5 skills). Tightened each instance in place — same meaning, fewer words — rather than extracting to a shared file, which ADR-0014's one-file-per-skill install constraint rules out. Left the three git skills' structured-result JSON shapes alone (coupled to the separate, out-of-scope git-orchestrate merge candidate, finding 19). Co-Authored-By: Claude Sonnet 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01YR2CjVumUbEGWcMikcoXBD |
||
|
|
f5e4d0d082 |
docs(git): delete unused git plugin config file and its read steps
Finding 21: `config.example.json` (and the never-tracked `.claude/plugins/git/config.json` it documented) was read by git-orchestrate and git-branches but written by nothing, and the default-inference fallback (GitHub Flow, with Gitflow inferred from a `develop`/`release/*` branch) already covered the no-config case. Removed the config-read step from both, updated git-workflow's description of the orchestrator to match, dropped the now-dangling `applied_config` field from git-orchestrate's output shape, and deleted the config file and its stale example reference in docs/spec/architecture.md. Co-Authored-By: Claude Sonnet 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01YR2CjVumUbEGWcMikcoXBD |
||
|
|
198eafd790 |
docs: mark simplification-audit findings 10, 12, 30 resolved
Checkbox and strikethrough findings 10, 12, and 30, each pointing at the commit that implemented it ( |
||
|
|
9eb8bc7e48 |
docs: add simplification audit of hooks, tests, plugins, and prose
Read-only analysis with 38 ranked findings, a measured pre-push baseline, and open questions for the hand-off discussion. No repo changes proposed are applied here. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01EmiHiknxqtZPEBnW7ujgNz |