feat(simplify-code): risk-tiered application, Chesterton's Fence, slop + silent failure detection - #49070
Merged
Conversation
… slop + silent failure detection
Five targeted enhancements to the upstream simplify-code skill:
1. Risk-tiered application (SAFE/CAREFUL/RISKY) — safe changes auto-applied,
careful changes verified per-file, risky changes flagged for human review.
Prevents auto-applying N+1 restructures and public API renames.
2. Chesterton's Fence — before flagging anything for removal, reviewers run
'git blame' to understand why it exists. Low-confidence findings are
escalated rather than guessed.
3. AI slop detection — Quality reviewer now catches: extra comments restating
obvious code, unnecessary defensive null-checks on validated inputs, 'as any'
casts, and patterns inconsistent with the rest of the file.
4. Silent failure detection — Efficiency reviewer now catches: empty catch
blocks, ignored error returns, except:pass, .catch(()=>{}) with no handling,
and error propagation gaps.
5. Structured reviewer output with confidence+risk tags — reviewers report in
'file:line → problem → fix | confidence: H/M/L | risk: SAFE/CAREFUL/RISKY'
format, enabling the orchestrator to tier the application.
Plus 3 new pitfalls: over-trusting dead code tools, public contract awareness,
and preserving intentional error handling.
Total: +45/-8 lines. Keeps the 212-line compact spirit.
Ref: #379
Contributor
🔎 Lint report:
|
| Rule | Count |
|---|---|
invalid-assignment |
1 |
First entries
tests/run_agent/test_credits_notices_toggle.py:76: [invalid-assignment] invalid-assignment: Object of type `None` is not assignable to attribute `_credits_session_start_micros` of type `int`
✅ Fixed issues (2):
| Rule | Count |
|---|---|
unresolved-attribute |
2 |
First entries
run_agent.py:2971: [unresolved-attribute] unresolved-attribute: Object of type `Self@get_credits_spent_micros` has no attribute `_credits_session_start_micros`
tests/run_agent/test_credits_notices_toggle.py:76: [unresolved-attribute] unresolved-attribute: Unresolved attribute `_credits_session_start_micros` on type `AIAgent`
Unchanged: 5789 pre-existing issues carried over.
Diagnostics are surfaced as warnings — this check never fails the build.
tonydwb
approved these changes
Jun 19, 2026
tonydwb
left a comment
There was a problem hiding this comment.
Code Review Summary
Verdict: Approved
Risk-tiered application (SAFE/CAREFUL/RISKY), Chesterton's Fence discipline, and slop + silent failure detection are all well-constructed additions to the simplify-code skill. The structured output format with confidence and risk tiers is a clear improvement over the flat high/medium/low confidence model.
Looks Good
- Risk-tiered apply order (SAFE first, CAREFUL with verification, RISKY flagged) is the right priority
- Chesterton's Fence requirement prevents false-positive dead-code removal
- AI slop patterns (obvious comments, unnecessary null-checks, as any casts) are real problems worth detecting
- Silent failure detection (except:pass, empty catch) is a valuable safety net
- New pitfalls (over-trusting dead code tools, renaming public contracts, removing error handling) are all practical
- Author attribution in release.py is trivially correct
Reviewed by Hermes Agent
1 task
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
The
simplify-codeskill now applies findings in explicit risk tiers (SAFE / CAREFUL / RISKY) instead of flat, and teaches its reviewers Chesterton's-Fence-via-git blame, AI-slop detection, and silent-failure detection.Salvage of #42209 by @Sahil-SS9 onto current
main(authorship preserved via cherry-pick).Changes
skills/software-development/simplify-code/SKILL.md(+45/-8):confidenceANDrisk: SAFE (auto-apply: dead code, unused imports, pass-throughs), CAREFUL (apply + verify per file: renames, ternary flattening, helper extraction), RISKY (flag for human review, never auto-apply: N+1 restructuring, public-API renames, concurrency/error-handling changes).git blamea line before flagging it for removal; if you can't determine why it exists →confidence: low, don't guess.as anycasts, file-inconsistent patterns.except: pass,.catch(() => {}); log before swallowing.Validation
descriptionunchanged (48 chars, ≤60). Prose references native Hermes tools (read_file,search_files,git blame).Closes #42209.
Infographic