GitHub - maciejjankowski/nsens-framework: Decision Governance Framework - validate ideas before building them. 51 cognitive biases, 4 adversarial personas, phase-gated validation P0-P5.

4 min read Original article ↗

OpenClaw tells you HOW to build. nSENS tells you IF you should build.

nSENS is a structured framework for validating business ideas before investing time and money. It combines adversarial review, cognitive bias detection, and formal logic validation into a repeatable process.

Why This Exists

Most startups fail not because the code was bad, but because the decision to build was wrong. nSENS catches fatal flaws at the idea stage - before they cost real money.

The framework was born from real experience: watching ideas get built without validation, seeing confirmation bias kill projects, and learning that the expensive part of building is building the wrong thing.

Key Features

Adversarial Validation Gate

Four personas attack your idea from different angles:

  • DARO (Short Seller) - Business viability: revenue inflation, broken GTM, impossible SLAs
  • BOZENKA (Auditor) - Evidence quality: missing data, weak validation, secondary sources
  • ASHY-SLASHY (Chainsaw) - Complexity: feature bloat, over-engineering, analysis paralysis
  • EMKA (Empathy) - Problem intensity: willingness to pay, customer commitment

Configurable roast level: mild, medium, or brutal.

51 Cognitive Biases Catalog

Pattern-matched against your reasoning with severity ratings and mitigations. Categories: decision, memory, social, speed, emotion, perception, systemic.

52+ Mental Models

With problem classification routing - the right model for the right problem type.

Phase-Gated Validation (P0-P5)

  • P0 Research - Market exists? Competitors? Failure modes?
  • P1 Discovery - Customer interviews, problem validation
  • P2 Design - Solution architecture, tech stack
  • P3 Implementation - Build the MVP
  • P4 Validation - Test with real users
  • P5 Reflection - What worked, what didn't, learnings

Each phase has kill gates. If the idea doesn't pass, you stop. No sunk cost fallacy.

Smart Plugin System

Plugins auto-activate based on phase, context keywords, and past performance. Scoring: phase match (40%), priority (20%), performance history (20%), context relevance (20%).

Decision Audit Trail

Every decision logged in JSONL (machine-readable) and Markdown (human-readable). Searchable, exportable, never loses data.

Ultra-Compressed Handoffs

Phase transitions captured in <250 tokens. State, learnings, next actions. Pause Monday, resume Friday - zero context loss.

Quick Start

from nsens import AdversarialGate

# Quick adversarial review of a business idea
gate = AdversarialGate(level="medium")

result = gate.validate({
    "topic": "AI-powered code review tool",
    "initial_confidence": 0.85,
    "pricing": {"model": "$50/seat/month", "validation": "None"},
    "gtm": {"customer_interviews": 3, "sales_process": "Unclear"},
    "features": ["PR review", "Security scan", "Style check", "Docs gen",
                  "Test gen", "Perf analysis", "Dep audit", "Migration",
                  "Refactoring", "API docs", "Schema gen"],
    "technical": {"tech_stack": "kubernetes microservices"},
    "prolog_constraints": 2,
})

print(f"Score: {result['initial_score']:.2f} -> {result['final_score']:.2f}")
print(f"Recommendation: {result['recommendation']}")
print(f"Issues found: {len(result['issues_found'])}")

for issue in result['issues_found']:
    print(f"  [{issue['category']}] {issue['issue']}")
    print(f"    -> {issue['feedback']}")

Output:

Score: 0.85 -> 0.43
Recommendation: DON'T BUILD
Issues found: 8
  [revenue_inflation] Pricing model has no validation
    -> Pricing needs customer validation. Talk to 10 customers.
  [gtm_broken] Only 3 customer interviews (need 10+)
    -> Need 10+ customer interviews. You have 3.
  [feature_bloat] 11 features planned (recommend max 5 for MVP)
    -> 11 features is too many for MVP. Focus on 3-5 core features.
  [over_engineering] Over-engineered architecture for MVP
    -> Start simple: monolith. Scale when you have users.
  ...

Full Engine Usage

from pathlib import Path
from nsens import NineSENSEngine

engine = NineSENSEngine(
    plugins_dir=Path("plugins"),
    phases_dir=Path("phases"),
    config_path="config.yaml",
)

result = engine.execute_phase(
    phase_name="p0_research",
    context={
        "idea": "AI-powered supply chain optimizer",
        "target_market": "Mid-size manufacturers",
        "budget": 100,
        "project_name": "supply-chain-ai",
        "next_phase": "p1_discovery",
    },
)

print(f"Status: {result.status}")
print(f"Plugins activated: {result.activated_plugins}")
print(f"Validations: {len(result.validations)}")

Catalogs

The framework ships with curated catalogs:

Catalog Count Purpose
biases.yaml 51 biases Cognitive bias detection with patterns
mental_models.yaml 52+ models Problem-solving frameworks with routing
personas.yaml 34 personas Multi-perspective analysis voices
research_prompts.yaml 45+ prompts Structured research questions
red_flags.yaml Red flags Warning signs by category
validation_rules.yaml Rules Prolog-style validation constraints

Architecture

nsens/
  core/
    engine.py              # Phase orchestrator
    adversarial_gate.py    # 4-persona adversarial review
    plugin_registry.py     # Smart plugin activation
    validator.py           # Multi-layer validation
    config_loader.py       # YAML config with validation
    decision_log.py        # Append-only audit trail
    handoff_system.py      # Ultra-compressed phase handoffs
    auditable_decision_logger.py  # JSONL + Markdown logging
  catalogs/                # Biases, models, personas, prompts
  phases/                  # P0-P5 phase definitions
  plugins/                 # Extensible validation modules

Writing Plugins

from nsens.core.plugin_registry import Plugin, PluginMetadata, PluginCategory, PluginPriority, PluginCapability

class MyValidator:
    @property
    def metadata(self) -> PluginMetadata:
        return PluginMetadata(
            name="my_validator",
            category=PluginCategory.BUSINESS,
            capabilities=[
                PluginCapability(
                    name="unit_economics",
                    description="Validates unit economics are viable",
                    inputs=["pricing", "costs"],
                    outputs=["unit_economics_result"],
                )
            ],
            phases=["p0_research", "p2_design"],
            priority=PluginPriority.HIGH,
        )

    def execute(self, context):
        # Your validation logic here
        return {"unit_economics_result": {"viable": True, "ltv_cac_ratio": 4.2}}

    def validate_inputs(self, context):
        return "pricing" in context

    def validate_outputs(self, result):
        return "unit_economics_result" in result

Philosophy

Less but validated. More code without clarity is net negative. More features without validation is waste. More analysis without action is procrastination.

nSENS enforces discipline:

  • Kill gates at every phase transition
  • Adversarial review before building
  • Evidence over opinion
  • Formal logic over gut feeling
  • Transparent decisions over black boxes

License

MIT