The people who made the decisions are gone
Maintaining 3 of 3 in Maintaining Aspects: epistemology (relating implicit and explicit) · breadth of considerations (context-crossing) · relationship with reality
Changing legacy code on the evidence of the code alone breaks purposes nobody remembers. The corrected path reads the record, asks who is left, and writes the recovered reasons down first.
Meta-rational here follows David Chapman: insights come frominvestigating the relationship between a system of technical rationality and its context
(Meta-rationality: An introduction). The pages call that stepping outside the procedure to ask whether it fits the situation.
Signals you are in this situation
Section titled “Signals you are in this situation”- The commit history is the only documentation, and the authors have left.
- A strange branch is kept because removing it once broke something.
- Nobody can say which customers depend on a behavior, only that some do.
- The team reads the code guessing at intent.
- Every proposal starts with “we think this is safe”.
The situation
Section titled “The situation”A billing system has run for nine years, and its three designers work elsewhere. A new team inherits it with a request to change how refunds are dated. In the code they find an uncommented rule: refunds issued in the last three days of a month are dated to the first of the next. Removing it seems safe. Two weeks after the change, finance reports that the quarterly figures no longer reconcile with the bank. The rule kept refunds out of a settlement window nobody on the new team had heard of, and the knowledge was in a person who had left.
Cindy Sridharan describes why this happens by design rather than negligence. Code is an imprint of the mental model of the engineers who wrote it, and that model is incomplete, possibly flawed, and short-lived. Each modification risks distorting the assumptions of the code before it, and after enough modifications the codebase is a patchwork of mental models that no single engineer holds. Reconstructing the original falls to a reader who arrives without the conversations that produced it.
The meta-rational perspective
Section titled “The meta-rational perspective”A rational approach reads the code as a specification of itself: what it does is what it is for, and a change that preserves observable behavior is safe. The refund rule shows what that misses. The code recorded a formal commitment, but the reason for it lived in the informal world of month-end settlement and was never written down because it was obvious to its authors. Chapman makes the general point: formal rationality cannot bridge the gap between a formalism and the reality it was made for, only everyday understanding does, and when the people who supplied that understanding leave, the formalism remains and the bridge does not.
Foote and Yoder describe the same condition from the architecture side. Systems get their shape from forces that were real at the time: deadlines, expedient repairs, a throwaway prototype that was never thrown away. They warn against reading the shape as arbitrary, and against reconstruction, which discards the experience embedded in the old system along with its problems. Their alternative is to cordon off what you do not understand, put a clear interface around it, and let the boundaries you can discern become the first landmarks of a recovered architecture. Geoffrey Litt’s reading of Stewart Brand adds that a building expresses all of its owners beam by beam, and the layers that survive are the ones later occupants could change without knowing why the earlier ones were placed.
Einar Høst supplies the correction: organizations make software, not programmers. The refund rule was a settlement arrangement between finance and a bank, expressed in code by whoever was nearest. The knowledge the new team needs is spread across roles still in the building, in finance, operations, and support, and across records never labeled as documentation: the issue tracker, old tickets, the log of what the system does at month end. Reading the code harder will not produce it. The meta-rational move is to treat the code as one witness among several, interview the others, and write down what was reconstructed where the next team will find it. Treating the code as a witness and the roles as others to question is an inference drawn from Sridharan and Høst, not a procedure either of them describes.
That last step is the one Sridharan asks for and the original authors skipped. Empathy for the future reader means recording the reasons that shaped the implementation, not only what it does. The durable output of the archaeology is a glossary and a set of decision records that say, for each strange branch, what it was for, who depends on it, and what would have to be true to remove it.
What stays rational
Section titled “What stays rational”When the system is documented, its authors are reachable, or the change sits inside a region the team already understands, the rational path holds: read the code, write the test, make the change, review it. Most legacy work is like this, and treating every strange line as a buried purpose would make the codebase untouchable. The archaeology is for the remainder: a rule with no comment, no test, and no author, in a system other departments depend on. Even then the first moves are rational ones, since a characterization test at a seam is the most reliable witness available; the research and questionnaire steps find out what that test should protect. The archaeology is unnecessary when someone in the room can explain the rule, and necessary when the explanation begins with a guess.
Failure path
Section titled “Failure path”How to read this chart
- A red outline marks a break point, where the process stops looking at the situation.
- A dashed, faded card is a step the process skips.
- A teal pill names a skill inserted at that step; click it for the description.
- A red dashed loop shows the same process restarting; a teal dashed loop shows a misfit noticed and sent back to an earlier step.
- A lettered badge marks where each loop starts.
The team reads the code as the whole truth about the system, and the strange rule, having no comment, is judged unused. Nobody asks finance, because the change is technical, and nothing is written down, because nothing seems worth recording. The existing tests pass, since the same authors wrote them under the same assumptions. The change ships and violates a purpose nobody remembered. The fix restores the rule, still without a comment, so the next team inherits the same trap.
Corrected path
Section titled “Corrected path”Reading the record and asking who is left become investigations rather than assumptions. The code is read as evidence alongside the commit history, old tickets, and month-end logs. The people still present are asked, by role, what they depend on. What is recovered goes into the glossary and the decision records before the change, so the change is made against a known purpose rather than a guessed one. Characterization tests at the seam pin what the system does today. When a change still surprises someone, the work goes back to asking who is left, because the surprise names a witness the archaeology missed.
Skills for this situation
Section titled “Skills for this situation”Central
Section titled “Central”| Skill | When to invoke it here | What it changes | Example |
|---|---|---|---|
research |
Before forming any view of what the code is for. | A background agent reads commit messages, closed issues, the pull request that introduced the rule, and the month-end logs, and writes cited findings to a file. | /research why refunds in the last three days of a month are dated forward; cite the commit, any ticket, and the month-end logs |
to-questionnaire |
Once the code has been read as evidence and the gaps are known. Typed command. | Sends written questions to the roles that still hold the informal knowledge, asking what they depend on rather than what the code does. | /to-questionnaire for the finance controller: what happens at month-end close that depends on refund dates? |
domain-modeling |
As soon as a recovered purpose has a name. | Writes the reconstructed vocabulary into GLOSSARY.md and the recovered reasons into ADRs, dated and marked as reconstructions. |
/domain-modeling record the settlement window as a term and the refund-dating rule as a decision with its reason |
Supporting
Section titled “Supporting”| Skill | When to invoke it here | What it changes | Example |
|---|---|---|---|
codebase-design |
When deciding where to make the change. | Supplies the vocabulary for putting a seam around the region not yet understood, so the change touches a known interface rather than the interior. | /codebase-design a seam around refund dating so the settlement rule is one module with one interface |
tdd |
Before the change, at that seam. | Characterization tests pin what the system does now, including the strange branch, so the change is rejected the moment it alters behavior anyone might depend on. | /tdd characterization tests for refund dating as it behaves today, including the month-end rule |
diagnosing-bugs |
When a change surprises someone despite the archaeology. | Runs the loop on the surprise, and the finding goes into the glossary, since a surprise here is a purpose that was missed. | /diagnosing-bugs why the quarterly reconciliation moved after the refund-dating change |
writing-for-agents |
When writing the record that will outlive this team. | Makes the reconstructed context something an agent or a future reader will find, with a pointer in AGENTS.md to the ADRs. |
/writing-for-agents review the ADR on refund dating so the next session reaches it before touching billing |
Common misreading
Section titled “Common misreading”One misreading turns every inherited system into a research project and changes nothing until its whole history is recovered. Foote and Yoder’s advice runs the other way: cordon off what you do not understand, work at the boundary, and recover purpose one strange branch at a time as changes require it. It has gone too far when the backlog is archaeology tickets and nothing has shipped.
A second misreading writes the recovered reasons into code comments and considers the job done. A comment beside the refund rule helps the next reader of that line, but the purpose belongs to finance and the settlement window, and what the next team will search for is a decision record naming the owner and the condition for removal. The symptom is a codebase with more comments and a glossary that still has no entry for the settlement window.
The strongest objection
Section titled “The strongest objection”The cost of recovering purposes is unbounded and the benefit speculative. Most strange branches in old code are dead, left by fixes for conditions that no longer exist, and a team that interviews finance about each of them will never ship. The rational alternative is to change the behavior, watch production, and restore what breaks. Sridharan’s own point that mental models are short-lived counts against the argument, because a reconstructed model is as likely to be wrong as the original.
The reply does not ask for total recovery. It asks that the code be treated as one witness among several before a change, and that what is learned be written down. The refund example shows why watch-and-restore is not free: the breakage appeared two weeks later in a quarterly reconciliation, at a cost no rollback undid. A reconstructed model can be wrong, which is why the decision records are marked as reconstructions and the characterization tests pin behavior rather than intent. Some branches are dead, as the objection says, and the questionnaire establishes that cheaply, before the deletion rather than after.
Sources
Section titled “Sources”Where this comes from: The claim that only reasonable, informal understanding bridges a formalism and the reality it was made for is from Chapman’s page on the ethnomethodological flip. The account of code as an imprint of a team’s mental model, and the duty to record the reasons for a future reader, is Cindy Sridharan’s. The forces that give a system its shape and the advice to cordon off what is not understood are Foote and Yoder’s. The claim that organizations rather than programmers make software is Einar Høst’s, and the beam-by-beam image is Stewart Brand’s as related in Geoffrey Litt’s thread. The refund-dating example was constructed for this page and is not taken from any reading.
- Cindy Sridharan, Effective Mental Models for Code and Systems.
- Brian Foote and Joseph Yoder, Big Ball of Mud, sections on the forces behind the pattern, “Sweeping It Under the Rug”, and “Reconstruction”.
- Geoffrey Litt, thread on How Buildings Learn.
- Einar W. Høst, Death of a Craftsman.
- David Chapman, The ethnomethodological flip.