COMMON SENSE RADAR · Decision records for business systems

Measure the distance
from common sense.
Talk through what
to keep and remove.

  • Private repos supported · never published without permission
  • 2 public scanned repos + 6 case studies open to inspect
  • Start with a scoped sample scan on 1 repository

01 · COMMON SENSE RADAR

Make deviations from
common sense visible.

When code departs from the usual way of doing things, only the people who wrote or decided it know whether it is a slip to remove or a strength to keep. Code nobody can explain is too risky to delete, so it turns into debt—and even a real strength becomes a shackle over time.

codenju treats the distance from common sense as a deviation and makes each one visible.

The score is not a report card. It is a marker for people to confirm how far something sits from general common sense—and whether it is kept under conditions or is a strength that earns revenue.

Public example · redis/redis

A concrete deviation is
an annotation on the repository.

Which code, what was chosen, and what was traded for it. codenju keeps that as an annotation on the actual lines of code.

src/ae.credis/redis @d2c8a4b
4void aeMain(aeEventLoop *eventLoop) {5    eventLoop->stop = 0;6    while (!eventLoop->stop) {7        aeProcessEvents(eventLoop, AE_ALL_EVENTS|8                                   AE_CALL_BEFORE_SLEEP|9                                   AE_CALL_AFTER_SLEEP);10    }11}1213/* ... L361-L408 ... */14int aeProcessEvents(aeEventLoop *eventLoop, int flags)15{16    int processed = 0, numevents;
  • ConditionalHuman-confirmed · review 2027-01-15
  • UnreadNobody has read it yet
General (the textbook answer) · example
Run work in parallel and use every CPU core
This team’s decision
Keep processing in a single flow (an event loop)
A weakness accepted knowingly
Limited CPU-core use per instance
What it bought
Predictable latency and a simple implementation
Annotations (1)Human-confirmed · review 2027-01-15
Example (built from a definition)L4–L11 (8 lines) C-2 YAGNI vs extensibilityIntentional deviation · Conditional

Redis — single-threaded event loop design

Constraint
As an in-memory KVS, low latency is mandatory. Multi-threading increases lock contention and debugging complexity.
Decision
Command processing is serialized on a single-threaded event loop. I/O is async via epoll/kqueue; CPU-bound work is delegated to forked child processes (RDB/AOF).
Consequence
CPU utilization per instance is limited, but latency stays predictable and the implementation stays simple. Scale horizontally via sharding.

review 2027-01-15 · @codenju

A deviation is not always something to remove.

General (the textbook answer) and the company standard. Read the gap with its reasons.

Review state (color) and read (shape)
RemoveConditionalKeep
UnreadNobody has read it yet
codenju’s read
Human-confirmed

The fuller the circle, the clearer the reason to keep it

Confirmed judgments become the company standard

  1. Fix or remove

    Slips and things no longer needed

    Spots left behind under deadline pressure, or old branches and rules that have outlived their purpose.

    If nobody knows what it is for, nobody dares to delete it. Once the reason is checked and it is clearly no longer needed, you can remove it with confidence and return to the standard way.

    A weakness nobody knew about → Remove

    A weakness nobody knew about
    Unintended gap · candidate weakness
    1. Unread
    2. codenju’s read
    3. Human-confirmed

    Aware: not yetRemove

    Example (draft): an old branch nobody can explain since its owner moved on.

  2. Write the conditions and keep

    A shape fitted to past constraints

    A shape chosen to fit the constraints or limits of its time.

    Business conventions, reworded terms, or an N+1 query capped at 10 items belong here. Write down the rule it relies on and when to review it, and you will notice as soon as the conditions change.

    A weakness accepted knowingly → Keep, with conditions written

    A weakness accepted knowingly
    Intentional deviation · conditional
    1. Unread
    2. codenju’s read
    3. Human-confirmed

    Aware: yesKeep, with conditions written

    Example (public redis example): CPU utilization per instance is limited, but latency stays predictable and the implementation stays simple. Scale horizontally via sharding.

  3. Protect first

    The company strengths that earn revenue

    A cache design built around your own access patterns, or mechanisms that reach deep into your domain.

    This deviation is what sets you apart and where revenue comes from. Rewriting it to general common sense or a generic library erases the strength, so record the reason and the scope to protect.

    A strength chosen on purpose → Protect

    A strength chosen on purpose
    Intentional deviation · candidate strength
    1. Unread
    2. codenju’s read
    3. Human-confirmed

    Aware: yesProtect

    Example (draft): a cache expiry tuned to your own access patterns. Switch to the textbook default and the strength goes with it.

Codenju takes the judgments expressed in code, starts from how they differ from common sense, and—through conversation with people—passes them on as value.