Skip to content

feat(simplify-code): risk-tiered application, Chesterton's Fence, slop + silent failure detection - #42209

Closed
Sahil-SS9 wants to merge 1 commit into
NousResearch:mainfrom
Sahil-SS9:feat/enhance-simplify-code
Closed

Sahil-SS9 wants to merge 1 commit into
NousResearch:mainfrom
Sahil-SS9:feat/enhance-simplify-code

Conversation

@Sahil-SS9

@Sahil-SS9 Sahil-SS9 commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Five focused enhancements to the new simplify-code skill (#379, #41691).

1. Risk-tiered application (SAFE/CAREFUL/RISKY)
The current skill applies all findings flat. This adds three risk tiers:

  • SAFE: auto-applied (unused imports, commented-out code, pass-through wrappers)
  • CAREFUL: applied per-file with test verification, reverted on failure
  • RISKY: flagged for human review, never auto-applied (N+1 restructures, public API changes)

2. Chesterton's Fence
Before flagging anything for removal, reviewers run git blame to understand why it exists. Prevents the most common cleanup disaster.

3. AI slop detection
Quality reviewer now catches: extra comments restating obvious code, unnecessary defensive null-checks on validated inputs, as any casts, patterns inconsistent with the file.

4. Silent failure detection
Efficiency reviewer now catches: empty catch blocks, ignored error returns, except: pass, .catch(() => {}) with no handling, error propagation gaps.

5. Structured reviewer output
Reviewers report in file:line → problem → fix | confidence: H/M/L | risk: SAFE/CAREFUL/RISKY format for tiered application.

Plus 3 new pitfalls: over-trusting dead code tools, public contract awareness, preserving intentional error handling.

Diff: +45/-8 lines. Keeps the 212-line compact spirit.

… 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: NousResearch#379
@alt-glitch alt-glitch added type/feature New feature or request P3 Low — cosmetic, nice to have tool/skills Skills system (list, view, manage) labels Jun 8, 2026
@Sahil-SS9 Sahil-SS9 closed this Jun 12, 2026
@Sahil-SS9
Sahil-SS9 deleted the feat/enhance-simplify-code branch June 12, 2026 17:05
@Sahil-SS9
Sahil-SS9 restored the feat/enhance-simplify-code branch June 18, 2026 15:10
@Sahil-SS9 Sahil-SS9 reopened this Jun 18, 2026
@teknium1

Copy link
Copy Markdown
Collaborator

Merged via #49070 — your commit was cherry-picked onto current main with your authorship preserved (db744e7). Thanks!

@Sahil-SS9
Sahil-SS9 deleted the feat/enhance-simplify-code branch August 28, 2026 12:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P3 Low — cosmetic, nice to have tool/skills Skills system (list, view, manage) type/feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants