Example

Application case study / Icetakes

Find a better home for shared code.

A diagram of a reading-site app we were building showed why adding its next workflow felt awkward: shared records and storage lived inside other workflows.

This is a development record of three findings, not a claim that the app is ready to deploy.

01 / Organization

Preparation needed storage owned by completion.

Before

Reuse crosses a workflow boundary.

LawyerPreparation imports JudgmentTask, jobs_table, and judgment_tasks_table from JudgmentCompletion.

After

Both workflows use a shared store.

Those definitions live in JudgmentStore. Preparation and completion each import the shared module.

Explore the recorded before/after maps and source

The view starts at create_preparation. Select a definition to read its checked source, or use the map controls to explore the whole program. On a phone, scroll inside the map.

Before: exact recorded source (raw artifact JSON) · After: exact recorded source (raw artifact JSON)

02 / Abstraction

Make validation read in the order it happens.

Before / excerpt

Repeat the error handling.

match required_basis_points(value):
  case DecodeError(path, reason): DecodeError(path, reason)
  case Decoded(score):
    match required_nonempty_string("congruence_reasoning", value):
      case DecodeError(path, reason): DecodeError(path, reason)
      case Decoded(congruence_reasoning):
        match required_event_time(value):

After / excerpt

Name each check, then continue.

score <- decode_bind(required_basis_points(value))
congruence_reasoning <- decode_bind(required_nonempty_string("congruence_reasoning", value))
event_time <- decode_bind(required_event_time(value))
Code & run Compare, edit, and execute both complete decoders

Before request and full decoder source · After request and full decoder source · Recorded inputs and outputs · Replay engine identity

03 / Improving Yichus

Sometimes the finding exposed a bug in the tool.

A string input was incorrectly called unused.

An unknown callback was incorrectly treated as storage-free.

Ask your agent about anything here; it has the detail.

Where this fits

What this is about: Lenses and Diagrams