$ fssg build --deterministic --validate |

Engineering Excellence as an Algorithm: The IOSM Methodology Manifesto

IOSM

In my previous post, I discussed how engineering discipline can serve the human task of preserving memory in the Memoria project. Today, I want to dig deeper and talk about the operating system of that philosophy—a methodology I call IOSM.

The world of software development is full of good intentions that often lead to chaos. Endless refactoring, bloated architectures, and technical debt that stifles innovation. We've all seen it. The problem isn't a lack of talent, but a lack of a reproducible, algorithmic approach to excellence.

IOSM is not just another set of practices. It is an algorithmic methodology for engineering excellence. It is my attempt to turn abstract values—clarity, efficiency, simplicity—into an executable discipline, ready for CI/CD integration through FACET.

🎯 Philosophy: The Four Axioms of System Evolution

At the core of IOSM are four fundamental values that serve as a compass for any engineering decision:

1. Clarity is a prerequisite for speed

An incomprehensible architecture and tangled code are anchors that slow down any long-term development. Before you can make a system fast, you must make it understandable.

2. Efficiency = Performance × Resilience

A fast but fragile system is useless. True efficiency is achieved at the intersection of speed and reliability.

3. Simplicity reduces risk and cost

The simpler a system is, the fewer hidden states it has, the easier it is to maintain, and the lower the cost of change.

4. Modularity is the engine of evolution

A system's ability to evolve is directly proportional to its capacity for change in isolated components without breaking the whole.

These principles sound obvious but are rarely applied systematically. IOSM transforms them from slogans into an algorithm.

🔄 Methodology: Four Steps to Excellence

IOSM is an iterative cycle of four sequential phases: Improve → Optimize → Shrink → Modularize. The key word here is "sequential." Skipping phases violates the integrity of the process and is the primary anti-pattern.

1. Improve: Focus on Clarity

Goal: To make the system understandable and correct.

At this stage, we refactor code for clarity, improve documentation, and align the architecture with business logic. We are not chasing performance; we are ensuring the system does what it's supposed to do, and does it in an obvious way.

@agent(name="improve_clarity")
  @task
    Analyze the system code and build a glossary of domain terms.
    Then apply unified naming conventions and eliminate logic duplication.

  @output
    glossary: # Dictionary of terms and their meanings
    duplicates: # List of found duplications
    refactored_files: # Files requiring refactoring

  @constraints
    - Preserve all external API contracts
    - Add invariants through assertions
    - Measure semantic clarity metrics

2. Optimize: Focus on Efficiency

Goal: To make the system fast and reliable.

Only after the system is clear can we optimize it. Here, we work on performance, introduce caching, and increase resilience.

Crucially: any optimization is performed only after defining clear metrics and baselines.

@agent(name="optimize_performance")
  @task
    Profile the system and create a performance baseline.
    Find bottlenecks and apply optimizations.
    Then run chaos testing and benchmarks.

  @output
    baseline:
      p50_ms: ~
      p95_ms: ~
      p99_ms: ~
    bottlenecks: # List of identified bottlenecks
    optimizations_applied: # Applied optimizations
    chaos_test_results: # Chaos testing results
    performance_gain: # Performance improvement in %

3. Shrink: Focus on Simplicity

Goal: To make the system simple.

We find and remove redundant code, unnecessary dependencies, and overly complex abstractions. This is the phase of "engineering minimalism," where we reduce the surface area for potential bugs without breaking the system's external contracts.

@agent(name="shrink_complexity")
  @task
    Find redundant APIs and dependencies in the system.
    Remove or merge duplicate interfaces.
    Measure onboarding time for new developers.

  @output
    redundant_apis: # List of redundant APIs
    removed_dependencies: # Removed dependencies
    api_surface_reduction: # API surface reduction in %
    onboarding_time_minutes: ~

  @constraints
    - Do not break external contracts
    - Maintain regression test coverage

4. Modularize: Focus on Evolution

Goal: To make the system scalable and adaptable.

In the final phase, we extract stable parts of the system into independent, loosely coupled modules. This prepares the system for future changes, allowing it to evolve predictably and safely.

Modularity for its own sake is pointless; it must serve the goal of future development.

@agent(name="modularize_system")
  @task
    Build a dependency graph of the system and identify clusters.
    Refactor code into independent modules with clear contracts.
    Ensure contracts pass testing.

  @output
    dependency_graph: # Dependency graph
    modules: # List of extracted modules
    contracts: # Defined contracts between modules
    coupling_score: # Coupling score (0-1, lower is better)
    cohesion_score: # Cohesion score (0-1, higher is better)

⚙️ IOSM + FACET Integration

What makes IOSM truly powerful? Integration with FACET turns the methodology into executable code. Each IOSM phase can be described as a FACET agent with clear inputs, outputs, and contracts.

Quality Gates Configuration via FACET

@config(name="iosm_quality_gates")
  @vars
    target_clarity: 0.95
    target_performance_p95: 150
    max_api_surface: 20

  @gate_improve
    semantic_score: {{target_clarity}}
    logical_consistency: 1.0
    max_duplication: 0.05

  @gate_optimize
    latency_ms:
      p50: 60
      p95: {{target_performance_p95}}
      p99: 250
    error_budget_respected: true
    chaos_tests_required: true

  @gate_shrink
    api_surface_reduction_percent: {{max_api_surface}}
    onboarding_time_minutes: 15

  @gate_modularize
    max_change_surface: 3
    all_contracts_pass: true
    min_cohesion: 0.7
    max_coupling: 0.3

IOSM-Index as a FACET Function

@function(name="calc_iosm_index")
  @vars
    weights:
      semantic: 0.15
      logic: 0.20
      performance: 0.25
      simplicity: 0.15
      modularity: 0.15
      flow: 0.10

  @task
    Calculate the integral health index of the system based on metrics from all IOSM phases.
    Each metric is multiplied by its weight, then summed.

  @input
    metrics:
      semantic: ~
      logic: ~
      performance: ~
      simplicity: ~
      modularity: ~
      flow: ~

  @output
    iosm_index: # Number from 0 to 1
    breakdown: # Breakdown of each metric's contribution

  @contract
    - iosm_index >= 0.0 and iosm_index <= 1.0
    - Target value: iosm_index >= 0.98

🚀 Why Does This Matter?

IOSM + FACET is the answer to the chaos of modern development. It is a way to eliminate the chaos in improvements, reduce the cost of change, and increase predictability. It is a practical tool for building systems that are simultaneously clear, fast, simple, and scalable.

Key Advantages:

  • ✅ Reproducibility — each cycle is described in FACET, executed deterministically
  • ✅ Predictability — clear contracts and quality gates guarantee results
  • ✅ Scalability — the methodology works at the level of modules, services, and portfolios
  • ✅ CI/CD Integration — FACET agents can be run in the pipeline automatically
  • ✅ Economic Justification — every improvement is tied to business metrics

🌐 Philosophy in Action: The Ecosystem

Like FACET, IOSM is part of my core philosophy: replace chaos with engineering.

This isn't just about writing code. It's about building resilient, evolving systems that reliably serve their purpose and deliver real value to the business.

This is engineering excellence, reduced to an executable algorithm.

Connection to the Ecosystem

IOSM works perfectly in conjunction with other tools:

  • FACET — defines contracts, guarantees determinism, and turns IOSM into executable code
  • IOSM — ensures the systematic improvement of the architecture through clear phases
  • RMCP — orchestrates the interaction of FACET agents and IOSM phases into a unified system

Together, they create a complete engineering discipline from the micro to the macro level:

@pipeline(name="iosm_full_cycle")
  @import "config/iosm_gates.facet"
  @import "agents/improve.facet"
  @import "agents/optimize.facet"
  @import "agents/shrink.facet"
  @import "agents/modularize.facet"

  @orchestrator(protocol="rmcp")
    Run the IOSM cycle: Improve → Optimize → Shrink → Modularize.
    At each stage, check Quality Gates from configuration.
    If a stage fails the gate - retry it with corrections.
    After successfully passing all phases - calculate IOSM-Index.

  @output
    phase_results: # Results of each phase
    gates_passed: # Which gates were passed
    final_iosm_index: # Final index
    recommendations: # Recommendations for next iteration

IOSM — the algorithmic methodology for engineering excellence, embodied in FACET. 🟠

Follow updates in the iosm category.

FACET AI CLI Terminal
facet@ai:~$