An exhaustive inventory of all 66 artifact types emitted by metarch-truthsrc (scala-cqrs-play-service-v2) classified by architectural layer, code role, ownership boundary, and specification origin, paired with a full-cycle post-mortem of 79 empirically verified bugs across the Friday real-PRD roadshow (Waves 4–8, 13 bugs) + Wave-9 deep audit (47 bugs) + differential/metamorphic/real-JVM/evolution probing (0010–0023, 19 bugs) (as of 2026-11-28).
Core Finding: Across all 66 artifact types, 54 (81.8%) live in the read-only generated zone, 8 (12.1%) live in the handwritten isolation zone, and 4 (6.1%) form locked test oracles. Only 14 artifact types (21.2%) derive directly from EARS behavioral specifications; the remaining 52 (78.8%) originate from structural models and Play/Akka runtime contracts.
Empirical Bug & Roadshow Verdict: All 79 verified defects occurred inside compiler gates, code generators, the read-only generated zone, or verification tooling. The "data-lineage blocker" hit mid-way during the Friday real-PRD roadshow (commit 8950ba3) was neither a Truth authoring error nor a codegen bug—it was a false-positive compiler gate block in lib/v2/lineage.mjs that forgot to register @PROPAGATED event-field consumption for event-triggered Policies.
scala-cqrs-play-service-v2 artifact types (54 generated · 8 handwritten · 4 locked oracles)3 Layers × 3 Roles × 2 Zones: Complete Spatial Map of All 66 Artifact Types
From an internal engineering perspective, every microservice generated by metarch-truthsrc partitions along two orthogonal axes: vertically across Domain / Application / Infrastructure (including Interfaces and Controllers), and horizontally across Structural Skeleton / Glue & Wiring / Behavioral Logic plus two strict ownership zones—the read-only generated zone (generated-scaffold/) and the handwritten isolation zone (handwritten/).
Behavioral code does not live exclusively in the handwritten isolation zone. Deterministic L1 domain rules, event folding (EventHandler), replay invariants (Axioms), ReadSide projections, and Policy state machines are emitted directly into the read-only generated zone. Only L2 non-deterministic computations (@host / ComputationsImpl), L3 cross-port application orchestration (*StoryImpl), external connectors, and authorization adapters land inside handwritten/ slots protected by overwriteCloze: false.
generated-scaffold/, while the amber slots beyond the dashed boundary represent handwritten/ isolation slots. Source: metarch-truthsrc v2 bridge and catalog.json inventory.| Layer & Artifact Group | Code Role | Ownership Zone | Origin | Count | Concrete Artifact Inventory (66 Total) |
|---|---|---|---|---|---|
| Domain Layer (11 total: 9 read-only generated · 2 handwritten) | |||||
| Kernel & Value Object Types | Skeleton | Generated Zone | Structural | 4 | CommonTypes, CborSerializable, ValueObject / ExactType (Money/Decimal), ExternalPayload |
| Entity State, Protocol & Params | Skeleton | Generated Zone | Structural | 2 | <Agg>Entity (State/Event), <Agg>RuleParams |
| Domain Computation Port & Bridge | Glue | Generated Zone | EARS + Struct | 1 | <Agg>Computations (declares L2 commands and @host function signatures) |
| Deterministic L1 Rules, Folding & Axioms | Behavior | Generated Zone | EARS-derived | 2 | <Agg>Rules (guards & postconditions), <Agg>EventHandler + <Agg>Axioms (2 classes: rules/folding + axioms) |
| L2 Non-Deterministic Computation Slots | Behavior | Handwritten Zone | EARS-derived | 2 | <Agg>ComputationsImpl (@host & non-L1 commands), <Target>Impl (L2 @cloze implementations) |
| Application Layer (15 total: 14 read-only generated · 1 handwritten) | |||||
| Use-Case Ports, Contracts & Read Views | Skeleton | Generated Zone | Struct + EARS | 5 | <Story>Port, CallerContractSpec, <View>, <Readside>Repository (Port), <Stem>Table |
| Aggregate Actor, Query & Outbound Ports | Glue | Generated Zone | Runtime | 5 | <Agg>Aggregate (Akka EventSourcedBehavior), <View>QueryService, OutboundConnectors, ToolGatePort, <Flow>InvocationFace |
| Projection, Policy & Saga Shells | Behavior | Generated Zone | EARS + Orch | 4 | <Readside>ProjectionHandler + Projection, PolicyMachine + <Policy>, <Flow>SagaModule / FixtureHost / CompositionHost, <Eff>EffectFace |
| L3 Application Story Orchestration Slot | Behavior | Handwritten Zone | EARS-derived | 1 | <Story>Impl (cross-port authz, extern checks, aggregate dispatch, response assembly) |
| Infrastructure & Interfaces Layer (36 total: 31 read-only generated · 5 handwritten) | |||||
| Proto3 Schemas, DDL & Build Config | Skeleton | Generated Zone | Struct + Build | 10 | <agg>.proto, shared_value_objects.proto, <flow>_host.proto, <eff>_effect.proto, <Readside>Schema (DDL), build.sbt, plugins.sbt, service.conf, dev.conf, routes |
| Play Controllers, Routes & API DSL | Glue | Generated Zone | EARS + API | 7 | ApiDto, <Story>Controller, HttpRouter, PlayHttpBridge, <Story>PlayController, AggregateStateApiController, AuthEndpointDsl / CommandDsl / HttpStatusMapper |
| Serializers, Converters & Persistence | Glue | Generated Zone | Runtime | 8 | SharedValueProtoConverters, <Agg>ProtoConverter, DomainConverters, DomainProtoSerializer, <Flow>HostSerializer, <Eff>EffectSerializer, <Readside>RepositoryImpl, ScalikeJdbcProjectionSession / InMemoryStore / PolicyDlqBury |
| Guice DI & Bootstrap Startup Chain | Glue | Generated Zone | Runtime | 6 | BootstrapModule, GeneratedBindingsModule, OnionBootstrap, OrchestrationModule, <Readside>Bootstrap / ProjectionModule, SagaCoordinatorBootstrap / ProcessBootstrap / EffectBootstrap |
| Infrastructure & External Integration Slots | Behavior + Glue | Handwritten Zone | Runtime | 5 | HandwrittenBindingsModule, AuthorizationPortImpl (PDP), ServerSnapshotProviderImpl, <Port>ConnectorImpl, <Eff>EffectPortImpl / <Stem>ApplyEventSemanticsImpl |
| Cross-Layer Governance & Locked Test Oracles (4 total: 4 locked) | |||||
| Z3 Locked Specs & Provenance Manifests | Test Oracle | Locked Test Zone | EARS-derived | 4 | <Agg><Cmd>EarsSpec (ScalaTest), <Story>EarsSpec (App + HTTP route specs), locked-tests.manifest.json, canonical-v2.json / knowledge.sqlite |
Friday Real-PRD Roadshow Post-Mortem (Waves 4–8): 13 Landmines & the Data-Lineage False Positive
On Friday, November 27, 2026, running an external real-world PRD end-to-end stalled mid-pipeline and triggered 5 rapid fix waves (Waves 4–8, commits 1e87c6a → ab207e7) covering 13 real bugs. Unlike static audits or differential fuzzers, these failures stemmed from uncut real-world business modeling—multi-aggregate event choreography, nested containers, package renames, and strongly-typed GET query parameters—exposing real user paths that curated demos never exercise.
Classifying the Lineage Blocker: Neither Bad Truth Nor Bad Codegen
Commit 8950ba3 (Wave-6) captures the exact data-lineage blocker hit during the roadshow. The PRD authored a completely valid event-triggered Policy (WHEN Event ... SHALL dispatch TargetAgg.Cmd) whose event fields propagated automatically to downstream command parameters via @PROPAGATED—the Truth specification was 100% correct.
The fault lived inside the static compiler gate lib/v2/lineage.mjs: Check 3 (verifyDispatchLineage) failed to record event fields consumed by event-triggered rules into consumedEventFields, causing Check 4 to emit a false-positive V2_LINEAGE_UNCONSUMED_* error and abort compilation. The fix took 3 lines of code, but the lesson is fundamental: a false positive in a static governance gate hurts real users just as badly as a compiler crash.
Lineage Gate · Hard Blocks (Default error)
post:or ReadModel references to missing or type-mismatchedeventField:/stateField:.- Type incompatibility between
dispatchparameters and upstream inputs. V2_LINEAGE_UNCONSUMED_NUMERIC_FIELD(defaultfailClosedNumeric = trueblocks unconsumed numeric event fields).
Lineage Gate · Soft Alerts (Default warning)
- Defined but unread:
DEAD_STATE_FIELD,WRITE_ONLY_STATE_FIELD,UNCONSUMED_EVENT_FIELD. - Downstream missing upstream:
DISPATCH_UNBOUND_PARAM,UNWRITTEN_STATE_FIELD,UNSOURCED_READMODEL_FIELD. - Requires
strictLineage = trueto escalate into hard blocks (legitimate write-only fields usewaiveLineage).
Lineage Gate · Three Real Blind Spots (False Negatives)
- Inside
@clozehandwritten bodies: Does not parse Scala bodies;DISPATCH_UNBOUND_PARAMassumes manual synthesis, requiring locked specs and mutation testing as backstops. - Cross-service async events: Scoped to a single BC (or merged subdomain); cannot statically prove remote upstream producers.
- Same-name semantic aliasing:
@PROPAGATEDaligns by name + type and cannot distinguish business meaning (e.g., orderidvs. userid).
Waves 4–5: Nested Containers & Package Renames (5)
1e87c6a: Nested Proto3 containers lackedBoxPOwrappers and converters (Infra Proto);PlayControllerdropped principal entitlements/attributes with case-sensitive lookup (Infra Play).93a6350: 2D nestedMap[String, Map[String, VO]]caused SMT/witness/codegen gaps andencVal/encBoolstack overflow (Domain SMT); handwritten slots lacked non-destructive method sync (Tooling); package rename left stale starter files (Governance).
Waves 6–7: Lineage FP, Optional & Typed GET (6)
8950ba3: Missing@PROPAGATEDconsumption tracking for event-triggered Policies (Compiler Gate);Optional[VO]member access lacked null-safe expansion in Scala & TS (Domain).cf4545a: Flow-sensitiveOptional[T]narrowing & OR boundary witnesses (M24); missingforall + sumcoupled LIA axioms (M26); schema-driven typed GET query parsing (M25);check-v2 --syncstale handwritten detection after package rename (M27).
Wave 8: Multi-BC Bridge & ReadSide Wrapping (2)
ab207e7(M28): Multi-BC#46 external-event-bridgemissed strongly-typed Payload VOs and completeslotMembers/identityKeywiring (App/Orchestration).ab207e7(M30):#26 ApplyEventand#28 ReadsideProjectionHandleromittedSome(...)wrapping when writing non-Optional event fields into Optional ReadModel columns (Infra ReadSide).
Spatial Distribution of All 79 Bugs: How Three Campaigns Cleared Different Blind Spots
Combining the Friday Roadshow (Waves 4–8, 13 bugs), the Wave-9 Deep Audit (0001–0007, 47 bugs), and Differential / Metamorphic / Real scalac+JVM / ReadSide-Saga Probing (0010–0023, 19 bugs) into 79 verified defects highlights sharp complementarity: the real-PRD roadshow caught compiler-gate false positives, nested containers, and rename friction; Wave-9 swept Play startup, Guice/Authz/DLQ, and gate bypasses; and differential + real-JVM execution exposed cross-stage SMT↔Scala semantic drift invisible to unit tests and code review.
1e87c6a (Wave-4) through 0e8df64 (0023). Note: the trailing amber segment on Infra Glue is 1 (PolicyMachine $aggType·); the leading teal segment on Application is 1 (M28 multi-BC bridge).AI Engineering Coding Root Causes: How These 79 Defects Systematically Formed
When AI participates heavily in building compilers, bridges, and code generators, these 79 bugs cluster tightly into 4 structural AI coding failure modes—mirroring Wang et al.'s (ICSE 2025) empirical taxonomy of 557 LLM code-generation errors, where semantic and contract misalignments vastly outnumber basic syntax errors:
1. Cross-Stage Semantic Drift
metarch-truthsrc spans five decoupled stages: Parser → Binder → smt-encoder → witness-materialize → ears-simplify / v1-strict-scala. When adding a feature in a single context window, AI routinely wires the first 2 stages while missing the downstream 3—producing Seq/Map is empty gaps, unregistered Record ==, 2D Map recursion, and missing @host Computations declarations.
2. Config-Equals-Runtime Illusion
AI readily conflates "a directive exists in a config or template" with "it is enforced at runtime." Classic cases: service.conf listed CSRFFilter while the live Play server let un-tokened requests pass (caught immediately by 0021 black-box E2E); v1-strict-orchestration claimed strict-saga-module while emitting stubs; Ubuntu CI's apt-get install scala silently pulled Scala 2.11 instead of 2.13.
3. Fail-Open / Silent Fallback Bias
To avoid crashes, AI defaults to .getOrElse(Zero), Try(...).toOption, and Boolean(val), silently swallowing fatal semantic errors: Money.create(0.01, "id_2").getOrElse(Money.Zero) zeroed out test amounts; coerceTypedValue('false', bool) silently returned true; ReadSide Optional columns turned corrupt JSON into None.
4. Combinatorial Interaction & Gate-FP Blindness
Single-factor unit tests hide two-factor interaction bugs (Optional[Record] × post:, 2D Map × Axioms), matching NIST SP 800-142; meanwhile, static governance gates (like lineage.mjs missing event-Policy @PROPAGATED or 248 drifted entries in docs/artifacts) stall real users with false positives whenever they lack real-PRD regression suites.
White-Box vs. Black-Box Discovery Matrix: Matching Weapons to Architectural Spaces
Empirically, no single verification technique captures more than 40% of real defects: real-PRD roadshows expose gate false positives and evolution friction; static audits catch explicit architectural violations; Pairwise + metamorphic + real-JVM traces dismantle cross-stage semantic drift; and live Play black-box E2E remains the sole proof of transport and security enforcement.
0023.| Code Space | Representative Failure Modes | White-Box Strategy | Black-Box / Cross-Runtime Strategy | Preventive Engineering Guardrail |
|---|---|---|---|---|
| Domain Behavior & SMT Translation (Generated) | Unregistered collection emptiness & Record equality, Option.copy & 2D Map compile errors, Optional[VO] null-safety, silent Money.Zero fallback |
Exhaustive AST unit tests, smt-encoder pre-registration invariants, lint banning .getOrElse(Zero) |
2-wise Pairwise + metamorphic equivalence + real scalac 2.13/JVM execution + 900-step stateful traces |
Enforce a 5-stage contract checklist (Parser / Bind / SMT / Materialize / Scala) for every new EARS AST node |
| Application & Saga Orchestration (Generated) | Stub Saga claiming saga-core, non-idempotent replay, cross-BC serializer ID collision, multi-BC #46 missing typed Payload VO |
Reuse certified v1 emitter/families/#40–#43 checkInput contracts, multi-BC merge collision tests |
Multi-subdomain BC merge compilation, duplicate/terminal event replay tests, Play route load tests | Forbid claiming uninvoked families in familiesUsed; bridge certified v1 saga-core families rather than ad-hoc stubs |
| Infra ReadSide / SQL / Proto (Generated) | Partial event overwrite wiping columns, Optional corrupt decode silently returning None, missing Some(...), nested Proto3 missing BoxPO, Int pagination overflow |
npm run test:proto-compat (<1s wire-evolution check), SQL reserved-word & fail-fast regex regressions |
Real PostgreSQL container running multi-event projections + corrupt-column injection + historical Proto byte replay | Standardize ReadSide updates on findById-merge-then-upsert; make proto-compat a blocking CI gate |
| Infra Play / HTTP / Authz / CSRF (Generated) | Configured CSRF filter inactive at runtime, dropped principal entitlements, typed GET query coercion mismatch, 401/403 inversion, Ubuntu CI pulling Scala 2.11 | Static lint (ban orphan app/, ban fallback userId), explicit CI toolchain pinning (Scala 2.13.14) |
Every transport assertion requires live Play server proof (401 / 403 / missing-CSRF 403 / malformed JSON 400 / cross-tenant denial) | Maintain a Transport Patch Checklist: any change to routes, filters, Authz, or Guice requires a matching live HTTP assertion in e2e-play-smoke |
Compiler Gates, Lineage & Cloze (Tooling + handwritten/) |
Event-Policy @PROPAGATED lineage false positive blocking builds, missed @host method sync on regeneration, stale starter files after package rename |
guard-write, overwriteCloze: false + syncMissingScalaMethods regressions, 100% mutation gate |
Locked *EarsSpec oracles + real-PRD E2E drills (including package renames, event edits, and multi-aggregate Policies) |
Pair every static gate rule with both positive and negative tests (preventing both FNs and FPs), and flag stale files in check-v2 --sync |
"The strict E2E assertions in 0021 turned 'CSRF is in the config' into 'CSRF actually blocks at runtime'; and Friday's 8950ba3 lineage false positive proved that static gates must guard against false positives just as fiercely as false negatives."
Industry Practice & Academic Literature: A Reusable Long-Term Playbook
The verification stack forged across these 79 fixes—real-PRD roadshows + formal models + Pairwise combinatorial suites + metamorphic equivalence + cross-runtime real-JVM differential traces + live-process black-box E2E—aligns directly with the strongest compiler and automated-reasoning engineering practices in industry and academia:
Industry Benchmark: AWS Cedar's Verification-Guided Development
AWS built the Cedar authorization engine using Verification-Guided Development (AWS Science, 2023): proving safety invariants in Dafny while running Differential Random Testing (DRT) across hundreds of millions of nightly inputs comparing the Dafny model against the Rust production engine. AWS specifically warns that purely random inputs concentrate in error branches and miss deep logic, necessitating policy-consistent generators—mirroring our Pairwise + Z3 witness-driven JVM differential harness.
Four Classic Pillars of Compiler & Translator Verification
- Differential Testing: McKeeman (1998) showed that feeding identical inputs to independent implementations directly exposes silent semantic bugs via output divergence.
- UB-Free Program Generation (Csmith): Yang, Chen, Eide & Regehr (PLDI 2011) uncovered 325+ GCC/LLVM bugs, proving that silent wrong-code defects are far more dangerous than compiler crashes.
- Metamorphic Testing & EMI / Semantic Fusion: Le, Afshari & Su (PLDI 2014) found 600+ compiler bugs via Equivalence Modulo Inputs; Chen et al. (ACM Computing Surveys 2018) systematized metamorphic relations for the oracle problem; Winterer, Zhang & Su (PLDI 2020) validated SMT solvers via Semantic Fusion (YinYang).
- Combinatorial Interaction Testing: Kuhn, Kacker & Lei (NIST SP 800-142) established the low-degree interaction rule explaining why 2-wise Pairwise catches the vast majority of multi-factor faults at minimal cost.
AI Coding Failure Taxonomy & Living Post-Mortem Discipline
Wang et al. (ICSE 2025) demonstrated across 557 LLM code-generation errors that syntactically valid yet semantically misaligned code is the norm. Accordingly, this report serves as a Living Post-Mortem: each time a real PRD, PostgreSQL stress test, cross-aggregate Saga bridge (#40–#43), or bilingual EARS run uncovers a new bug, it is logged into its exact "Layer × Role × Zone" cell and converted into a permanent white-box or black-box gate.
References
- William M. McKeeman (1998). Differential Testing for Software. Digital Technical Journal, 10(1), 100–107.
- D. Richard Kuhn, Raghu N. Kacker, & Yu Lei (2010). Practical Combinatorial Testing. NIST Special Publication 800-142.
- Xuejun Yang, Yang Chen, Eric Eide, & John Regehr (2011). Finding and Understanding Bugs in C Compilers. Proc. ACM SIGPLAN PLDI 2011, 283–294.
- Vu Le, Mehrdad Afshari, & Zhendong Su (2014). Compiler Validation via Equivalence Modulo Inputs. Proc. ACM SIGPLAN PLDI 2014.
- Tsong Yueh Chen, Fei-Ching Kuo, Huai Liu, Pak-Lok Poon, Dave Towey, T. H. Tse, & Zhi Quan Zhou (2018). Metamorphic Testing: A Review of Challenges and Opportunities. ACM Computing Surveys, 51(1), Article 4.
- Dominik Winterer, Chengyu Zhang, & Zhendong Su (2020). Validating SMT Solvers via Semantic Fusion. Proc. ACM SIGPLAN PLDI 2020.
- Amazon Science / AWS Automated Reasoning Group (2023). How we built Cedar with automated reasoning and differential testing.
- Zhijie Wang et al. (2025). Towards Understanding the Characteristics of Code Generation Errors Made by Large Language Models. Proc. IEEE/ACM ICSE 2025.