Help us improve
Share bugs, ideas, or general feedback.
From code-coherence
Verifies independence of multiple critic layers by measuring overlap in rejection patterns and independence scores for Swiss cheese model validation.
npx claudepluginhub reggiechan74/cc-plugins --plugin code-coherenceHow this skill is triggered — by the user, by Claude, or both
Slash command
/code-coherence:swiss-cheese-validationThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Verify that multiple critic layers have orthogonal failure modes, ensuring the Swiss cheese model is working correctly. Measure overlap in critic rejections and warn if critics catch the same errors.
Adversarially reviews any artifact (design docs, plans, code, PRs, docs) by dispatching a Devil's Advocate subagent, fixing findings, and iterating with fresh reviewers until clean or stagnation.
Performs on-demand adversarial quality reviews of deliverables using criticality-based (C1-C4) strategy templates, executes templates, and scores quality via LLM-as-Judge rubric. Integrates with quality-enforcement SSOT.
Stress-tests code, architecture, PRs, and decisions via structured adversarial analysis. Uncovers hidden flaws with Devil's Advocate reasoning and metacognitive depth. Use for high-stakes review or deliberate problem-finding.
Share bugs, ideas, or general feedback.
Verify that multiple critic layers have orthogonal failure modes, ensuring the Swiss cheese model is working correctly. Measure overlap in critic rejections and warn if critics catch the same errors.
The Swiss cheese model achieves reliability through misaligned holes:
Target: Independence score > 0.85 (less than 15% overlap)
Analyze rejection patterns across sessions:
code_rejections = sessions_where_code_critic_vetoed
security_rejections = sessions_where_security_critic_vetoed
overlap = code_rejections ∩ security_rejections
union = code_rejections ∪ security_rejections
independence_score = 1 - (|overlap| / |union|)
Interpretation:
From research paper (522 sessions):
| Critic Pair | Overlap | Independence |
|---|---|---|
| Code vs Security | 2.3% | 0.977 ✓ |
| Code vs Domain | 3.1% | 0.969 ✓ |
| Security vs Domain | 0.8% | 0.992 ✓ |
High overlap detected when:
Causes:
Solutions:
Default (hardcoded):
layers:
- code-critic
- security-critic
- domain-critic
Custom (user-configured):
layers:
- code-critic
- security-critic
- financial-critic
- performance-critic
Dynamic (context-based):
layers:
financial_files: [code-critic, financial-critic]
auth_files: [code-critic, security-critic]
api_files: [code-critic, performance-critic]
SWISS CHEESE VALIDATION REPORT
Analysis Period: Last 30 days (87 sessions)
INDEPENDENCE SCORES:
✓ Code vs Security: 0.981 (excellent)
✓ Code vs Domain: 0.973 (excellent)
✓ Security vs Domain: 0.995 (excellent)
OVERLAP ANALYSIS:
- Code & Security both rejected: 2 sessions (2.3%)
Reasons: Authentication logic had both syntax error AND security flaw
- Code & Domain both rejected: 3 sessions (3.4%)
Reasons: Financial calculation had logic error AND violated precision rules
- Security & Domain both rejected: 1 session (1.1%)
Reasons: Data validation missing AND violated GDPR requirements
CONCLUSION: ✓ Swiss cheese model working correctly
All critics demonstrate orthogonal failure modes.
⚠ INDEPENDENCE CONCERN DETECTED
Analysis: Last 30 days (87 sessions)
POOR INDEPENDENCE:
❌ Code vs Security: 0.72 (poor - 28% overlap)
ISSUE: Both critics rejecting same sessions frequently
Sample overlaps:
- Session #42: Both caught missing input validation
- Session #55: Both caught SQL injection in user input
- Session #61: Both caught unescaped HTML in output
ROOT CAUSE: Security critic checking code-level details
RECOMMENDATION: Refocus security critic on OWASP patterns only,
let code critic handle general logic validation
Run validation automatically after every 20 sessions:
monitoring:
frequency: every_20_sessions
alert_threshold: 0.80
action: warn_user
references/independence-verification.md - Statistical methods for measuring orthogonalityreferences/failure-mode-analysis.md - Common causes of critic overlapexamples/poor-independence.md - Case study of overlapping critics and remediation