Skip to content

The obvious data model breaks on reality

Ontology 1 of 2 in Ontology Aspects: ontology · categories (reflection on boundaries) · contingencies (anomalous)

A schema drawn from typical cases rejects real data and accumulates special cases; the corrected path decides where structure ends, tests that boundary, and revises categories instead of patching.

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.

  • Validation keeps rejecting real records: names, addresses, dates, quantities.
  • Every sprint adds another special case to the same table or type.
  • A field is nullable for now and nobody can say what null means.
  • Support tickets describe the same edge case in different words.
  • A column called notes or extra holds structured data.

Hillel Wayne opens a confectionery textbook at random and sketches a data model for its recipes: a recipe is a list of ingredients, and an ingredient is a food with a mass. The next page calls for twenty-five lemon skins, so a measure has to be a mass or a count. The page after that lists foil cups, which are not food. Then an ingredient is optional, then one is a choice between two foods, then a recipe contains a sub-recipe with its own list. Each page breaks the model, and the model that survives is more complex and more fragile than the one he started with.

People break models the same way. John Graham-Cumming’s surname contains a hyphen. A web form rejected it as containing invalid characters, and every airline he has flown with records him as GRAHAMCUMMING. The lists of falsehoods programmers believe collect such cases for names, addresses, email, time, and much else. Each entry is an obvious assumption that reality violates.

William Kent’s book on data modeling starts from the observation that data structures are maps and no map is the territory. An information system models a small part of the world on the expectation that one construct inside it corresponds to one thing outside it. Even that expectation fails at once. Is a part one kind of thing, as in an inventory file, or one physical object, as in a quality-control file? Each application resolves the ambiguity from context without noticing, and the resolution is lost when the two files are integrated. Kent’s conjecture is that information is too amorphous and too subjective for any formal model to capture completely, and that models are indispensable anyway.

Chapman’s account of ontological remodeling supplies the constructive side. Formal rationality works inside a fixed ontology, usually an implicit one, and that works while the ontology is good enough for the job. When it is not, rationality cannot repair it, because it cannot see its own categories. Meta-rationality treats the categories as changeable. A category can be dropped, demoted to an informal heuristic, or given a new formal meaning, and the choice depends on where the boundaries fall. Wayne’s practical proposal is the wastebasket, a deliberately unstructured place such as a free-text field for the cases that will not fit, with the structured model reserved for the cases that matter. The data cannot say which cases those are. That depends on what the software is for and who pays for each mismatch.

Every schema is wrong somewhere. The failure is a process that patches each anomaly in place, so that the model accumulates special cases without anyone deciding where its boundary should be.

Where the domain already has a settled formal ontology, a strict schema is right and cheap. Amounts in a single currency, ISO country codes, an order status set that your own process defines, a foreign key to a table you control: type these, constrain them, and validate them hard, using the type system and the database. There is no wastebasket to design because no case fails to fit. These categories were defined by a formal system rather than abstracted from the world, so reality cannot surprise them. The corrected path is for counting-as categories: names, addresses, times, ingredients, anything people decided informally before software arrived.

1 Look at typical cases the first three recipes 2 Fix the schema one ingredient is one food and a mass 3 Validate strictly anything else is rejected 4 Build on the schema forms, storage, reports 5 Ship tests pass on the typical cases 6 Real data arrives 25 skins, foil cups, a hyphenated name 7 Patch per case special case 14 is added each exception becomes a new column and a new bug
How the situation goes wrong when handled purely rationallyHow to read
How to read this chart
1 Normal step a step the process takes as intended 2 Break point where the process loses contact with the situation 3 Skipped step a step the process never takes 4 Skill inserted click a pill to read about the skill grilling: Interviews you round by round until nothing about a plan is left silently assumed.grilling GLOSSARY.md: The project glossary: the domain vocabulary every skill reads and writes.GLOSSARY.md A red loop: the same process restarts B teal loop: a misfit noticed sends work back
  • 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 schema is drawn from the typical cases, fixed, and enforced with strict validation, and everything downstream is built on it. When real data arrives with foil cups, counts instead of masses, and hyphenated names, validation rejects it, and each rejection becomes a special case. The special cases accumulate into the fragile model Wayne warned about, and the users whose data was rejected have meanwhile been told that their names are invalid.

1 Sample widely real data plus the falsehood lists research: Sends a background agent to primary sources and writes cited findings to a file.research 2 Model the edges invent the odd cases on purpose domain-modeling: Challenges overloaded terms and writes the glossary and decision records.domain-modeling 3 Draw the boundary what gets structure, what gets a wastebasket grill-with-docs: Grilling that also writes glossary entries and ADRs as decisions settle.grill-with-docs ADRs: Architecture decision records: dated, reasoned decisions kept in docs/adr/.ADRs 4 Test the boundary one test per falsehood tdd: The red-green-refactor loop with rules for tests worth keeping.tdd 5 Reuse what exists a proven library for names, addresses, time research: Sends a background agent to primary sources and writes cited findings to a file.research 6 Ship with a way out free text where the model gives up implement: Implements a spec or tickets test-first at agreed seams.implement 7 Review anomalies remodel, do not patch domain-modeling: Challenges overloaded terms and writes the glossary and decision records.domain-modeling B a real anomaly: revise the categories, not the special cases A a test would not pass: move the boundary
The same path with skills inserted at the break pointsHow to read

Edge cases are hunted before the schema is fixed. The boundary between structured and unstructured is a recorded decision, and tests encode the falsehoods that were considered. Established libraries are preferred for the domains where the falsehood lists are longest. A test that cannot pass goes back to the boundary decision. A real anomaly goes back to the categories rather than into the patch queue. Wayne proposes the wastebasket and Chapman the remodeling; the choice of Pocock’s skills for each step is this guide’s.

Skill When to invoke it here What it changes Example
domain-modeling While the model is still a sketch. Invents edge-case scenarios, challenges each category, and records in GLOSSARY.md what an ingredient, a measure, or a name is for this system. /domain-modeling what counts as an ingredient here: foil cups, optional items, either-or choices, sub-recipes?
grill-with-docs When deciding what the model will refuse to represent. Typed command. Interrogates the boundary until it is a decision, and writes it as an ADR. /grill-with-docs where the recipe model stops and free text begins
tdd Once the boundary is decided. Turns each considered falsehood into a test, so tests enforce the boundary instead of validation rules that reject people. /tdd a name field that accepts hyphens, apostrophes, single names, and four-part names
Skill When to invoke it here What it changes Example
research Before drawing the schema, and again before writing a parser. A background agent reads the falsehood lists and records which established library already handles the domain. /research which falsehoods about postal addresses apply to us, and which library handles them
implement For the build. Typed command. Builds the model with its escape hatch in place, so an unforeseen case degrades to unstructured data rather than to a rejection. /implement the recipe model from the ADR, with the free-text fallback
domain-modeling, again Whenever a new anomaly arrives in production. Treats the anomaly as evidence about the categories, which may need splitting, demoting, or sending to the wastebasket. /domain-modeling a recipe arrived that lists an ingredient by volume; revisit the measure category

One misreading turns the wastebasket into a philosophy. Since reality is nebulous, everything becomes free text, and the system can no longer answer a basic question because nothing is structured enough to query. The symptom is a reporting request that can only be met with a regular expression over a notes column.

The opposite misreading models every entry on a falsehood list, so the name table gains forty nullable columns for cases the product will never meet. Both skip the decision: where the boundary between structured and unstructured belongs for this software and these users, written down.

Strict schemas catch errors at the point of entry, where they are cheapest to fix, and a free-text wastebasket loses data quality. Nothing in it can be validated, joined, or reported on, and it absorbs the cases that most needed attention. On this view the falsehood lists argue for modeling more carefully and testing more, not for giving up on structure.

The reply is that the wastebasket is a recorded boundary, not a dumping ground. What goes in it is decided deliberately, with the cost of each mismatch in view, and revisited when an anomaly turns out to matter. Strictness stays where it pays. What fails is the unmanaged alternative: a model that accumulates special cases without anyone deciding where it should stop.

Where this comes from: the constructive argument is Chapman’s interlude on ontological remodeling, with the readings list’s ontology section pointing at Wayne and Kent. The examples are Wayne’s recipe model, Graham-Cumming’s surname, and Kent’s preface and first chapter.