Overview
NO MERCY is the enforcement arm of the Prismatic Platform doctrine. It establishes absolute, non-negotiable quality standards that apply to every line of code, every agent operation, and every platform decision across the entire 2.8 million line codebase. Where NO DOUBTS governs the epistemology of decision-making, NO MERCY governs the execution standard: complete delivery or no delivery.
The doctrine emerged from a pragmatic observation: technical debt compounds faster than financial debt. A single TODO comment becomes ten. A stub function becomes a pattern. An untested module becomes an untestable subsystem. NO MERCY prevents the first crack from forming by enforcing absolute quality standards at every checkpoint in the development lifecycle, from the first keystroke to production deployment.
NO MERCY is not aspirational. It is enforced through automated pre-commit hooks, CI pipeline gates, Quality Gates, and agent operational constraints. The platform's current quality score of 100/100 across all 13 quality domains with zero warnings, zero debt, and zero violations is the direct result of NO MERCY enforcement applied consistently across 99 umbrella applications.
Core Principles
The NO MERCY doctrine comprises four foundational principles, each addressing a specific category of quality failure that plagues conventional software development.
Principle 1: Zero Incomplete Implementations
Every feature, fix, or change must be 100% complete before delivery. The platform does not accept "Phase 1" implementations that defer critical functionality, feature flags hiding incomplete code, or partial migrations that leave the codebase in a mixed state.
| Forbidden Practice | Required Practice |
|---|---|
| Partial implementations shipped as "v1" | Full feature completion before merge |
| "Phase 1" with documented missing parts | Complete MVP or defer entirely |
| "Will fix later" annotations | Fix now or do not ship |
| Feature flags hiding incomplete code | Working code only in production |
| Dead code from abandoned approaches | Clean removal of superseded code |
| Commented-out code "for reference" | Version control provides history |
The enforcement mechanism validates completeness at the pre-commit level:
defmodule PrismaticSafety.CompletenessValidator do
@moduledoc """
Validates that all code changes are complete before allowing commit.
Enforces NO MERCY Principle 1: Zero Incomplete Implementations.
"""
@forbidden_patterns [
~r/# TODO:/i,
~r/# FIXME:/i,
~r/# HACK:/i,
~r/# XXX:/i,
~r/:not_implemented/,
~r/raise "Not implemented"/,
~r/raise "TODO"/,
~r/fn _ -> :stub end/
]
@spec validate_changeset(changeset :: list(String.t())) ::
:ok | {:error, :incomplete, list(String.t())}
def validate_changeset(changed_files) do
violations =
changed_files
|> Enum.flat_map(&scan_file_for_violations/1)
|> Enum.reject(&false_positive?/1)
case violations do
[] -> :ok
found -> {:error, :incomplete, found}
end
end
defp scan_file_for_violations(file_path) do
file_path
|> File.read!()
|> String.split("\n")
|> Enum.with_index(1)
|> Enum.flat_map(fn {line, line_num} ->
@forbidden_patterns
|> Enum.filter(&Regex.match?(&1, line))
|> Enum.map(fn pattern ->
"#{}:#{} - Forbidden pattern: #{inspect()}"
end)
end)
end
defp false_positive?(violation) do
# Test files may reference TODO patterns in assertions
String.contains?(violation, "_test.exs")
end
endPrinciple 2: Zero Stubs, Mocks, and Placeholders
Production code contains only production-ready implementations. This extends beyond obvious TODO comments to include any code that exists as a placeholder for future work.
| Violation Type | Detection | Status |
|---|---|---|
# TODO: implement later | Regex scan in pre-commit | BLOCKED |
# FIXME: known bug | Regex scan in pre-commit | BLOCKED |
def placeholder_function, do: :not_implemented | AST analysis | BLOCKED |
raise "Not implemented" | AST analysis | BLOCKED |
| Mock objects in production code | Module analysis | BLOCKED |
| Empty function bodies (no-ops) | AST analysis | WARNING |
| Stub modules with minimal implementation | Coverage analysis | BLOCKED |
The automated detection system scans every commit for prohibited patterns:
# Automated scanning integrated into pre-commit hooks
# Scans all staged Elixir files for forbidden patterns
# Exit code 1 if any matches found = commit blocked
# Pre-commit hook excerpt (.githooks/pre-commit)
# Phase: NO MERCY stub detection
mix compile --warnings-as-errors --force
mix credo --strictPrinciple 3: Comprehensive Test Coverage
Every line of code must have corresponding test coverage. The platform enforces multiple levels of test coverage to ensure that code is not merely executed during tests but meaningfully verified.
| Coverage Type | Target | Enforcement Level |
|---|---|---|
| Line coverage | 100% | HARD - commit blocked |
| Branch coverage | 100% | HARD - commit blocked |
| Function coverage | 100% | HARD - commit blocked |
| Regression tests per bug fix | Mandatory | HARD - commit blocked |
| Property-based tests for business logic | Required | HARD - PR blocked |
| Integration tests for cross-module flows | Required | HARD - PR blocked |
Every public function requires a minimum set of test scenarios:
defmodule Prismatic.Perimeter.SecurityRatingTest do
use ExUnit.Case, async: true
use ExUnit.Parameterized
alias Prismatic.Perimeter.SecurityRating
# 1. Happy path test - core functionality works
describe "calculate/1 with valid input" do
test "calculates security rating for domain with full data" do
evidence = build_evidence("example.com", findings: 3, critical: 0)
assert {:ok, rating} = SecurityRating.calculate(evidence)
assert rating.grade in [:A, :B, :C, :D, :F]
assert rating.score >= 300 and rating.score <= 900
end
end
# 2. Error case tests - failures handled gracefully
describe "calculate/1 with invalid input" do
test "rejects nil evidence" do
assert {:error, :invalid_evidence} = SecurityRating.calculate(nil)
end
test "rejects evidence without required fields" do
assert {:error, :missing_fields} = SecurityRating.calculate(%{})
end
test "rejects negative finding counts" do
evidence = build_evidence("test.com", findings: -1)
assert {:error, :invalid_findings} = SecurityRating.calculate(evidence)
end
end
# 3. Edge case tests - boundary conditions
describe "calculate/1 edge cases" do
test "handles domain with zero findings (perfect score)" do
evidence = build_evidence("clean.com", findings: 0, critical: 0)
assert {:ok, %{grade: :A}} = SecurityRating.calculate(evidence)
end
test "handles domain with maximum findings" do
evidence = build_evidence("bad.com", findings: 10_000, critical: 500)
assert {:ok, %{grade: :F}} = SecurityRating.calculate(evidence)
end
end
# 4. Property-based test - invariants hold across all inputs
describe "calculate/1 properties" do
property "score always within valid range" do
check all findings <- StreamData.integer(0..1000),
critical <- StreamData.integer(0..findings) do
evidence = build_evidence("prop.com", findings: findings, critical: critical)
{:ok, rating} = SecurityRating.calculate(evidence)
assert rating.score >= 300 and rating.score <= 900
end
end
property "more critical findings never improve grade" do
check all base_critical <- StreamData.integer(0..50),
additional <- StreamData.integer(1..50) do
base = build_evidence("prop.com", findings: 100, critical: base_critical)
worse = build_evidence("prop.com", findings: 100, critical: base_critical + additional)
{:ok, base_rating} = SecurityRating.calculate(base)
{:ok, worse_rating} = SecurityRating.calculate(worse)
assert worse_rating.score <= base_rating.score
end
end
end
defp build_evidence(domain, opts) do
%{
domain: domain,
findings: Keyword.get(opts, :findings, 0),
critical: Keyword.get(opts, :critical, 0),
timestamp: DateTime.utc_now()
}
end
endPrinciple 4: Zero Warnings in Production
The codebase compiles and runs with zero warnings across all analysis tools. Warnings are treated as errors at every level, from the Elixir compiler to Dialyzer static analysis to Credo code quality checks.
| Warning Source | Enforcement Mode | Current Status |
|---|---|---|
| Compiler warnings | --warnings-as-errors flag | 0 violations |
| Dialyzer type warnings | Zero tolerance, PLT cached | 0 violations |
| Credo issues | --strict mode | 0 violations |
| Runtime warnings | Logged, investigated, fixed | 0 violations |
| Deprecation warnings | Immediate migration required | 0 violations |
| Unused variable warnings | Compilation blocked | 0 violations |
Missing @spec annotations | Credo check enforced | 0 violations |
Missing @impl annotations | Custom check (709 verified) | 0 violations |
# Required verification for every commit
mix compile --warnings-as-errors --force # Zero compiler warnings
mix dialyzer --format dialyxir # Zero type analysis warnings
mix credo --strict # Zero code quality issues
mix test --cover # All tests passing with coverageViolation Protocol
The NO MERCY violation protocol defines escalation levels and mandatory responses for quality standard breaches. The protocol is automated wherever possible and enforced by both technical gates and organizational policy.
Severity Levels
| Level | Description | Example | Response | Automation |
|---|---|---|---|---|
| L1 | Minor deviation | Style inconsistency, naming convention | Warning + immediate correction | Pre-commit auto-format |
| L2 | Quality violation | Missing test, uncovered branch | Block + required correction | CI pipeline gate |
| L3 | Incomplete delivery | Partial feature, TODO in code | Rejection + restart required | Merge gate rejection |
| L4 | Repeated violations | Pattern of quality lapses | Escalation + supreme review | Audit trail trigger |
Enforcement Pipeline
The enforcement pipeline ensures that NO MERCY violations are caught at the earliest possible stage, minimizing the cost of correction:
Code Change --> Pre-commit Hooks --> Quality Gates --> CI Pipeline --> Merge Gate --> Production
| | | | | |
Authored Format check Full compile All tests Code review Monitoring
locally Credo strict Dialyzer Coverage Quality score Alerts
Quick tests TODO scan Security Approval Self-heal
TODO scan Pattern check Benchmarks Final gate Guardian
Each stage is a hard gate: failure at any stage blocks progression to the next. There are no override mechanisms, no bypass flags, and no exceptions for urgency or deadline pressure.
Quality Score Framework
The platform maintains a comprehensive quality score that aggregates all NO MERCY enforcement dimensions into a single metric:
| Domain | Weight | Current Score | Enforcement |
|---|---|---|---|
| Compilation (zero warnings) | 10% | 100% | --warnings-as-errors |
| Dialyzer (zero type errors) | 10% | 100% | PLT analysis |
| Credo (zero issues) | 10% | 100% | --strict mode |
| Test coverage (line + branch) | 15% | 100% | ExCoveralls |
| Regression test compliance | 10% | 100% | Mandatory protocol |
| @impl annotation coverage | 5% | 100% | 709 verified |
| @spec type annotation coverage | 10% | 100% | Custom check |
| TODO/FIXME absence | 5% | 100% | Regex scanner |
| Memory safety | 5% | 100% | Pattern analysis |
| Performance compliance | 5% | 100% | Benchee gates |
| DateTime precision | 5% | 100% | Pattern check |
| Guard function usage | 5% | 100% | AST analysis |
| Unsafe map access absence | 5% | 100% | Pattern detection |
Current Platform Quality Score: 100/100 (PERFECT) across all 13 domains.
CASCADE Pattern Elimination
NO MERCY includes a systematic approach to eliminating recurring anti-patterns through the CASCADE (Comprehensive Automated Scan and Correction of Anti-pattern Deficiency Elimination) system. Five core CASCADE patterns have been identified and eliminated platform-wide:
| CASCADE Pattern | Description | Instances Eliminated |
|---|---|---|
| Type Mismatch | Incorrect type annotations in @spec | 127 |
| Dead Code | Unreachable code paths and unused functions | 203 |
| Empty Check | Missing empty collection guards | 89 |
| Timer Replacement | Unsafe Process.sleep usage | 34 |
| Nuclear Cache | Stale compilation artifacts causing false errors | 452 |
The Nuclear Cache fix remains a critical maintenance tool:
# Nuclear Cache resolution - eliminates stale BEAM artifacts
rm -rf _build/dev/lib/prismatic_claude/ebin && rm -rf priv/plts/dialyzer.plt
mix compile --warnings-as-errors --forcePlatform Integration
NO MERCY integrates with every enforcement layer of the Prismatic Platform to create a defense-in-depth quality assurance system:
- NO DOUBTS: Complementary doctrine -- NO DOUBTS ensures correct decisions; NO MERCY ensures complete execution
- Quality Gates: Technical enforcement of NO MERCY standards at every commit
- Trinity Gate: Formal verification layer for critical claims and decisions
- NABLA Axioms: Evidence requirements grounded in epistemic axioms
- Regression Tests: Mandatory regression protocol prevents bug recurrence
- Session Discipline: Continuous commit and push enforcement prevents work loss
- Telemetry Integration: Monitoring ensures NO MERCY standards maintained in production
- Real-Time Monitoring: Quality Floor Guardian tracks score continuously
- Autonomous Self-Healing: Automated correction when violations detected
- AIAD Standard: All 400+ agents operate under NO MERCY constraints
- Color Teams: Adversarial testing validates enforcement effectiveness
Metrics and Results
The NO MERCY doctrine has produced measurable, auditable results across the platform:
| Metric | Before NO MERCY | After NO MERCY | Improvement |
|---|---|---|---|
| Quality score | Variable (60-85) | 100/100 constant | Perfect score |
| QDP (Quality Debt Points) | 905 accumulated | 0 (complete elimination) | 100% reduction |
| Compiler warnings | 50-100 per build | 0 per build | 100% elimination |
| Dialyzer violations | 30+ per analysis | 0 per analysis | 100% elimination |
| Credo issues | 200+ per scan | 0 per scan | 100% elimination |
| Production incidents | ~8 per month | < 1 per month | 88% reduction |
| Post-deploy rollbacks | ~3 per month | 0 per month | 100% elimination |
| Developer confidence | Survey: 6.2/10 | Survey: 9.4/10 | 52% improvement |
Commands
| Command | Purpose | Authority |
|---|---|---|
/quality-gates | Run all NO MERCY quality checks | Universal |
/quality-enforce | Systematic enforcement across codebase | System |
/cascade | Execute CASCADE pattern elimination | System |
mix quality.gates | Full quality gate pipeline | CI/CD |
mix compile --warnings-as-errors | Zero-warning compilation | Pre-commit |
mix credo --strict | Zero-issue code quality | Pre-commit |
Connect & Contribute
Created by Tomáš Korcak (korczis) | Open Source under GHL