Facet 12 · The Error Model

The Taxonomy of Failure

PCLexError · PCParseError · PCScopeError · PCRenderError · PCRuntimeError — and what these five diagnoses reveal about medicine, law, aviation, engineering, and civilizational resilience
Facet 12EngineeringMedicineResilience

Introduction

Every error in Prospectus Celestial has a name, a stage, a cause, and a recovery path. This is not an engineering convenience — it is a civilizational insight. The greatest advances in medicine, law, engineering, aviation, and science have not come from avoiding failure but from developing precise languages to name, classify, and recover from it. A civilization that cannot name its failures cannot learn from them. A pipeline that cannot classify its errors cannot recover gracefully. The five PCML error types are five philosophies of failure, written in code.

"To name a thing is to begin to understand it. To classify a failure is to begin to prevent it." — after Carl Linnaeus (who gave us the taxonomy of life, not of errors, but the principle is the same)

The Five PCML Error Types

PCLexError
Stage: Lexer · "I cannot recognize this character"
Raised when the Lexer encounters a character it cannot classify into any token type. The input is not even parseable as language — it is noise at the recognition level. Example: an unsupported Unicode character in a tag name, or a lone backslash outside a string literal.
PCParseError
Stage: Parser · "I recognize the words but the grammar is wrong"
Raised when recognized tokens do not form valid grammatical structures. The lexer succeeds but the parser fails. Example: a missing closing brace, an attribute on the wrong domain's tag, a nested block in an invalid position.
PCScopeError
Stage: AST Builder · "The grammar is correct but the references don't resolve"
Raised when a variable reference, ID reference, or cross-domain binding points to something that does not exist or is not accessible from the current scope. Example: referencing a private variable from another scene, or using #undeclaredId.
PCRenderError
Stage: Renderer · "The structure is valid but the assets are missing or malformed"
Raised when the Renderer attempts to produce output and fails due to a missing asset, invalid layer assignment, or Win2D draw failure. Example: @image src="missing.png", an out-of-range color value, a GPU resource allocation failure.
PCRuntimeError
Stage: Runtime (during Update tick) · "The scene loaded but an expression failed during execution"
Raised during live execution when an expression evaluation fails: a division by zero, a null dereference, a stack overflow from infinite fragment recursion, or an invalid type coercion.
// Catching and handling PCE errors in C#
try
{
    var scene = await PCFileService.LoadSceneAsync("game.pcs");
}
catch (PCLexError e)    { Log($"Unrecognized character at {e.Line}:{e.Column}"); }
catch (PCParseError e)   { Log($"Grammar error: {e.Message}"); }
catch (PCScopeError e)   { Log($"Unresolved reference: {e.Identifier}"); }
catch (PCRenderError e)  { Log($"Render failure: {e.AssetPath}"); }
catch (PCRuntimeError e) { Log($"Runtime fault: {e.ExpressionId}"); }

Medicine: The Original Taxonomy of Failure

Modern medicine is built on the taxonomy of failure. The International Classification of Diseases (ICD), now in its 11th edition (ICD-11, 2022), contains over 55,000 diagnostic codes — a classification system for every known way a human body can fail. Before the ICD (first edition, 1893), a death might be recorded as "fever" or "weakness" — symptoms, not causes. The shift to causal classification (pneumococcal pneumonia vs. viral pneumonia vs. aspiration pneumonia) made it possible to treat them differently, track them epidemiologically, and develop targeted therapies.

The five PCML error types map directly onto medical classification principles:

PCLexError ↔ Unrecognized symptom
The diagnostician cannot even categorize what they are seeing. A symptom that fits no known pattern. Before germ theory (Pasteur, 1861), most infectious diseases were PCLexErrors — unclassifiable because the underlying cause was unknown.
PCParseError ↔ Structural disorder
The body parts are recognizable but their arrangement is wrong — a congenital heart defect, a dislocated joint, a malformed valve. The components exist; the grammar of their assembly is violated.
PCScopeError ↔ Autoimmune disorder
The immune system references its own tissues as foreign — a scope error where "self" and "other" are confused. Lupus, rheumatoid arthritis, and Type 1 diabetes are all PCScopeErrors of the immune system's reference resolution.
PCRenderError ↔ Nutritional deficiency
The body's structure is valid, but a required resource (a vitamin, a mineral, a hormone) is absent. Scurvy (Vitamin C deficiency) is a PCRenderError: the blueprint for healthy collagen exists, but the asset is missing.
Metaphor
"A PCRuntimeError during @expression execution is a seizure: the scene's structure is perfectly valid, the assets are all present, the render pass completed — but during live execution, an electrical storm disrupts the intended sequence. Recovery requires a controlled reset, not a rebuild."

Exact technology: The Human Patient Simulator (Laerdal, 1967 — first clinical training mannequin) introduced a radical idea: let medical students encounter failures in a safe environment and recover from them before encountering them in real patients. Today, high-fidelity simulation centers train surgeons, anesthesiologists, and emergency physicians to recognize and recover from all five error types before they occur in living patients. The simulation is a PCEngine that deliberately injects errors into the scene.

Law: Due Process as Error Classification

The common law tradition (England, ~12th century CE; formalized in Magna Carta, 1215) is a taxonomy of legal failure: wrongs are classified, procedures are defined for each class, and remedies are matched to classifications. Without classification, all wrongs would receive the same response — an impossibly blunt instrument. With classification (tort, crime, breach of contract, constitutional violation), the legal system can respond proportionally and precisely.

The hierarchy of courts mirrors the five error stages: Lexer errors (unintelligible filings — rejected at the clerk's window), Parser errors (procedurally defective filings — dismissed for want of jurisdiction or standing), Scope errors (valid filing, wrong court — transferred to proper venue), Render errors (valid claim, missing evidence — summary judgment for failure of proof), Runtime errors (valid claim, valid evidence, but a legal error made during trial — grounds for appeal).

The Fifth Amendment right to due process is an error-handling guarantee: the government cannot impose consequences for a failure it has not properly classified, proven, and matched to a defined remedy. This is PCE's error hierarchy written in constitutional language: every error must be raised at the correct stage, with the correct type, before a consequence is imposed.

Engineering: Failure Mode and Effects Analysis

Failure Mode and Effects Analysis (FMEA), developed by the US military in the 1940s and formalized in MIL-P-1629 (1949), is a systematic method for identifying every way a component can fail, classifying the failure mode, assessing its severity and probability, and designing mitigations. Every modern aircraft, automobile, medical device, nuclear reactor, and spacecraft is designed using FMEA.

The Apollo 1 fire (January 27, 1967) killed three astronauts when a PCRenderError — a missing asset (fire-resistant materials) combined with an ignored PCParseError (faulty wiring that had been noted but not fixed) — produced a catastrophic PCRuntimeError during a ground test. The subsequent redesign, led by engineering director George Low, was the most comprehensive FMEA in space program history. Every component was re-examined, re-classified, and re-tested. The result was the Apollo spacecraft that landed on the Moon 29 months later. The taxonomy of failure saved the program.

Metaphor
"The PCEngine's five error types are a cockpit warning system. PCLexError is the 'unknown input' light. PCParseError is 'structural fault.' PCScopeError is 'navigation reference lost.' PCRenderError is 'fuel/asset missing.' PCRuntimeError is 'engine failure in flight.' Each light triggers a different checklist. Without the lights, the pilot is flying blind."

Aviation: Black Box Culture and the Learning Organization

Commercial aviation is the safest form of mass transportation in human history — approximately 0.07 fatal accidents per million departures in 2023. This extraordinary safety record was achieved not by making aircraft perfect, but by developing a culture of ruthless, non-punitive error classification. The Flight Data Recorder (black box, required by the FAA since 1958) and the Cockpit Voice Recorder (required since 1966) exist to classify failures after they occur so that the entire industry can learn from each one.

The Aviation Safety Reporting System (ASRS, established by NASA and the FAA in 1976) allows any aviation professional to report safety concerns anonymously, without penalty. As of 2024, the ASRS database contains over 2 million reports — the world's largest repository of near-miss and error data. Every report is a classified error, analyzed and distributed as a learning artifact. The database is PCE's error log, published to the entire industry instead of being discarded after each flight.

Exact numbers: In 1972, there were 55 fatal commercial aviation accidents worldwide. In 2023, there were 5 — across roughly 4.5 billion passengers carried. The 99.991% reduction in fatality rate over 51 years is the direct result of systematic error classification, not of error prevention alone.

Science: Falsification as Error-Finding Protocol

Karl Popper's philosophy of science (1934, The Logic of Scientific Discovery) reframes science as a systematic error-finding protocol: a good scientific theory is one that makes specific predictions that could, in principle, be proven wrong. The more precisely a theory specifies what would count as its failure (its PCRenderError conditions), the more scientific it is. A theory that can explain any possible outcome explains nothing — it is an expression with no error conditions, which is logically equivalent to always returning true.

The Large Hadron Collider at CERN — the most complex scientific instrument ever built — is fundamentally an error-classifier. It generates proton collisions at 13 TeV of energy to search for patterns that differ from Standard Model predictions. Every deviation is a classified anomaly: a potential PCScopeError (an unexpected reference, a particle that shouldn't be there) that might indicate new physics. The Higgs boson (discovered 2012) was found precisely because physicists knew exactly what signal to look for and what constituted a statistically significant deviation from the null hypothesis. They had written the error specification before they ran the experiment.

Recovery Strategies by Error Type

Error TypeCauseRecovery StrategyCivilizational Parallel
PCLexErrorUnrecognized input characterReport line/column; fail fast; suggest nearest valid tokenMedical: unclassifiable symptom → specialist referral
PCParseErrorValid tokens, invalid grammarReport expected vs. found; show surrounding context; offer auto-fix hintsLaw: defective pleading → amendment allowed, not dismissal
PCScopeErrorUnresolved reference or access violationReport identifier name; show declaration scope; suggest public exposureDiplomacy: unrecognized state → negotiation before conflict
PCRenderErrorMissing asset or GPU failureSubstitute placeholder asset; log asset path; continue rendering other layersEngineering: missing part → substitute or redesign, don't scrap
PCRuntimeErrorExpression fault during executionCatch in expression sandbox; reset expression state; continue scene if non-criticalAviation: engine failure → checklist, controlled landing

The Grand Error Table: Failures Across Civilization

PCML ErrorMedicineLawEngineeringAviationScience
PCLexErrorUnclassifiable symptomIllegible filingUnknown materialUnknown anomalyUnfalsifiable claim
PCParseErrorStructural malformationProcedural defectAssembly errorChecklist violationExperimental design flaw
PCScopeErrorAutoimmune disorderWrong jurisdictionInterface mismatchNavigation errorFalse positive (wrong ref)
PCRenderErrorNutritional deficiencyMissing evidenceMissing componentFuel exhaustionInstrument failure
PCRuntimeErrorAcute crisis (seizure)Trial errorField failureIn-flight emergencyReplication failure
Metaphor
"A civilization that cannot name its errors is a scene with no error handlers — it crashes on the first exception and loses all state. A civilization with a precise taxonomy of failure is a scene with full try-catch coverage: it handles each error at the correct stage, recovers what it can, logs what it must, and continues rendering."