liveBook · Manning

Poka-yoke

As explained in Build High Value Software Systems

Poka-yoke is a mistake-proofing technique that uses a physical or logical barrier to prevent an error from occurring.

Poka-yoke is a physical or logical barrier that prevents an error rather than warning someone after it happens. In software, a CI check can fail a build when a change moves an async call into a synchronous request handler. section 12.2.1

When a mistake recurs or is caught only by luck, look for a constraint that makes it impossible. Alerts and dashboards detect problems; poka-yoke prevents them. A check might block the async change until it is corrected or its latency impact receives review from the endpoint’s SLA-owning team. section 12.2.1

Deployment pipelines can enforce constraints such as:

  • Requiring a reverse operation for migrations, with an approved exception for irreversible changes. section 12.4
  • Requiring production confirmation flags, schema validation, immutable build artifacts, or a runbook link before deployment. section 12.4
Listing 12.5 CI gate that enforces rollback compatibility
def check_migration_rollback(migration_file: str) -> bool:
    """Reject migrations that lack a reverse operation."""
    content = read_file(migration_file)
    has_forward = "def upgrade(" in content or "def forwards(" in content
    has_reverse = "def downgrade(" in content or "def backwards(" in content
    
    if has_forward and not has_reverse:
        raise MigrationError(
            f"{migration_file} has no rollback. Add a downgrade() function "
            f"or set IRREVERSIBLE=True with tech lead approval."
        )
    return True

This CI gate rejects a migration without a reverse operation unless a tech lead approves it as irreversible. section 12.4

How Build High Value Software Systems covers it

How deep it goes
Defines prevention against detection and gives CI examples, without developing a general implementation procedure.
Examples
Uses one-way connectors, brake-dependent shifting, async-handler CI checks, rollback gates, and deployment constraints as illustrations.
What it assumes
Builds on observing production failures and recognizing repeated or luck-caught human errors; no technical prerequisites are stated.
What you can do after
Apply it via CI and deployment pipelines by rejecting changes that permit known errors or omit required safeguards.
How it connects
Links mistake-proofing to gemba, Lean manufacturing, standard work, CI pipelines, alerts, and dashboards.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Build High Value Software Systems. The section links point to the parts of the book it draws on.