Idea
Project / Lenses and diagrams
See how a program is organized.
To understand a large codebase, you need to see its building blocks, which abstractions are reused, and where definitions depart from the conventions used elsewhere. Those relationships can be hard to follow across many files.
Usually you learn this from a tour by someone who knows the code well, then build your own picture over months of working in it.
For programs written in the typed functional language Bosatsu, Yichus draws these structures from the compiled source. Use the maps to get to know a codebase, to keep as a reference while you work, and to check that an agent is building in a pattern you like, so you can tell it to change course when it isn’t.
Here is Icetakes, a community reading site built with Yichus, as a layer diagram. Its packages judge submitted articles with the help of a “lawyer” model, which is why so many names start with Lawyer. Each box is a package, and each arrow points to a package it is built from. The diagram places each dependency below the packages that use it. What differs between programs is how far the arrows reach and where direct IO operations sit.
Try itTap a package to see what it uses, what uses it, and which tables it reads and writes.
Loading the Icetakes layer diagram. Read about the lenses.
Inside one package
The forum app on this site is a single package. Building blocks arranges definitions by their dependencies. Most reused highlights definitions that many others use. Recurring shapes groups definitions with similar types so you can compare how they are written.
Try itTap a definition, then switch tabs to see it from another side.
Loading the forum’s lenses. Read about the lenses.
Checking an agent’s work
Lenses also show when an agent copies logic instead of reusing it. In this shop, cart, checkout, and support each work out how much stock can be sold.
Try itPress After the fix to see the program once the copies share one definition.
Loading the recorded dependency map. Read the stock-rule example.
Code & run Edit the stock logic and redraw the map
Inspect larger programs and compare refactors
The program-structure workbench lets you expand groups and follow references in a larger example. The worked examples explain which facts each view can show and how those facts stay tied to the source.
A dependency arrow says that one definition refers to another. It does not establish execution order or prove that a permission check runs. Use a view matched to the question you are asking.
All Yichus projects · Work with your agent