docs: audit recipes for Python, TypeScript, Rust, Go, polyglot, monorepo#100
Merged
Conversation
…onorepo (#96) Adds docs/audits/ — copy-pasteable klasp.toml configurations stratified into minimal/serious/strict tiers for each major stack. Each recipe includes target audience, install commands, commit-vs-push split, hard-block vs warning baselining guidance, KLASP_BASE_REF scoping for runtime budgets, expected agent-visible findings, and false-positive escape hatches. Includes a graduation-path section for when a recipe should become a first-party klasp-plugin-<stack>. The polyglot.md and monorepo.md docs cover composition across stacks using nearest-klasp.toml discovery and per-package vs root config strategies. A new integration test (klasp-core/tests/audit_recipes_parse.rs) extracts every fenced TOML block from all six docs and asserts each parses against ConfigV1, with prelude wrapping for the structured [[checks]] / [[trigger]] / [gate] fragments. Surfaces drift loudly on schema changes. Closes #96. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Three brittleness fixes from /simplify review:
1. is_version_field — was starts_with("version") && contains("= 1"),
which matched versionless = 1 / version_note. Now splits on = and
compares the trimmed key against "version".
2. is_gate_table_header — was line == "[gate]", which rejected the
trailing-comment form [gate] # see recipes.md. Now strips prefix
and accepts trailing whitespace or an inline #-comment.
3. BareFieldFragment was the silent catch-all; a future doc with a
top-level triggers = [...] array would smuggle into [checks.source]
and parse spuriously. Added an Unknown variant + is_simple_bare_field
guard. Test runner panics on Unknown with file:line + snippet so a
novel fragment shape forces a classifier update.
Five regression cases in classify_recognises_each_block_shape lock the
new behaviour in.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Three lines exceeded rustfmt's preferred width after the classifier hardening commit. Reflows them under fmt.
Contributor
Author
Code review🟢 All-green. No high-signal issues. Summary
Critical issuesNone. SuggestionsNone worth blocking on. Two cosmetic finds were considered and skipped per the skill's "no pedantic nits" threshold:
What looks good
Verdict🟢 Approve. CI is green, classifier is well-tested, schema accuracy is mechanically validated by the smoke test, doc voice matches the project's existing style. Ship it. Reviewed via |
Contributor
Author
Review remediationNo remediation required — the code review at step 7 returned 🟢 all-green with zero high-signal findings, so step 10 (triage-followups) was skipped per the protocol's skip-eval. This comment exists so the merge-gate's audit trail is complete; nothing to fix.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #96. Adds
docs/audits/— copy-pasteableklasp.tomlconfigurations stratified into minimal/serious/strict tiers for each major stack, plus composition guides for polyglot and monorepo repos.docs/audits/README.mddocs/audits/python.mddocs/audits/typescript.mddocs/audits/rust.mddocs/audits/go.mddocs/audits/polyglot.mdklasp.tomldiscovery, root vs per-language strategiesdocs/audits/monorepo.mdEach recipe ships: target audience + repo shape, install commands, three-tier
klasp.tomlsnippets, commit-vs-push split, hard-block vs warning baselining,KLASP_BASE_REFdiff-scoping, expected agent-visible findings, false-positive escape hatches, graduation path to a first-party plugin.README.mdanddocs/recipes.mdlink to the new section.Smoke test
klasp-core/tests/audit_recipes_parse.rsextracts every fenced TOML block from all 6 docs and asserts each parses withConfigV1. Fragments are classified (whole config /[gate]-only /[[checks]]-or-[[trigger]]/ bare-field) and wrapped with the matching prelude before parse.After review: classifier tightened against three brittleness traps (
versionless = 1no longer false-matches as a whole config;[gate] # commentis recognised; novel fragment shapes hit a newUnknownarm that fails loudly with file:line+snippet rather than smuggling into the wrong wrapper).55 TOML blocks across the 6 docs all parse; 5 regression cases lock the classifier behaviour.
Test plan
cargo test -p klasp-core --test audit_recipes_parse— 3 tests pass (smoke + fence-extractor lock-in + classifier lock-in)cargo clippy -p klasp-core --tests -- -D warnings— cleanklasp install --agent claudeto confirm it gates as advertisedtypescript.mdmatches current fallow usage and the relationship the project wants to conveyAcceptance criteria (from #96)
docs/audits/README.mdexplaining audit recipe philosophydocs/audits/python.mdwith tiers + copy-pasteableklasp.tomldocs/audits/typescript.mdwith fallow integration guidancedocs/audits/rust.mddocs/audits/go.mddocs/audits/polyglot.mdANDdocs/audits/monorepo.mdshowing compositionREADME.mdanddocs/recipes.mdConfigV1🤖 Generated with Claude Code