All work

Architectural-CAD intelligence (foundation)

CAD Understanding

An evidence-first foundation that turns a delivered architectural CAD package into typed, content-hashed, provenance-tracked evidence — engineered so a reasoning model can later interpret real drawings without ever drifting from the exact CAD.

766 / 766
readable-sheet dimensions yielding a supported geometric measured value
Documented · real-package dimension audit
51
foundation tests pass in under 2s — proves foundation integrity, not architectural accuracy
Documented · foundation test suite
13
explicit dimension text-overrides surfaced rather than silently trusted
Documented · dimension audit
4
evidence tiers every delivered file is typed into at the ingestion boundary
Documented · ingestion boundary
0
element-named identifiers permitted in foundation code — enforced by a build-failing AST gate
Documented · G2 AST gate

The problem

Real architectural CAD deliveries are messy: nested blocks, non-resolving external references, corrupt sheets, and dimensions whose displayed text may not match their true geometry. Any system that hopes to reason about these drawings — to eventually support quantity takeoff and other construction workflows — will produce confident, wrong answers unless every fact it accepts stays grounded in and verifiable against the exact CAD. The hard problem is not the model; it is building a substrate honest enough to keep a model from hallucinating in a high-stakes domain.

Constraints

  • Accepted facts must remain CAD-grounded and independently verifiable — no interpretation may enter the foundation as an unearned assumption.
  • Element vocabulary (door, window, room) must come from the project's own schedules and tags, never from hardcoded modules — real deliveries do not share one office's conventions.
  • The substrate must never silently drop data: corrupt drawings and missing references have to surface as evidence, not disappear.
  • DWG source is not directly parseable; it is converted out-of-band to DXF, so the conversion itself has to be recorded as provenance rather than assumed lossless.
  • AI cost must stay bounded and subordinate — the model transport is priced and capped before it is ever wired in.

Approach & key decisions

  • Make 'element types are evidence, not code' an executable law, enforced by an AST gate that fails the build if any element-named identifier leaks into foundation code.

    Hardcoding door/window/room logic would silently bake one office's conventions into a system meant to generalize across real deliveries. A build-failing gate turns a design principle into something that cannot quietly erode over time.

  • Build an exact-CAD extraction substrate as the moat: expand nested blocks into world-space primitives with full ancestry, apply coordinate-system transforms, and derive content-based IDs that survive re-extraction.

    Exact vector structure — geometry, text, dimensions, blocks, provenance — is a richer and more reliable substrate for a reasoner than pixels. Computer vision was explicitly rejected as the path; stable content IDs let a downstream model cite and re-verify a fact even after unrelated file edits.

  • Keep delivered-source evidence and derived evidence strictly separate, and read the CAD's own declarations only as structurally-typed claims (generic text, tag attributes, dimensions, leader notes) with no office-shaped classification.

    Conflating what the drawing literally says with what the system inferred is how a pipeline starts lying. Typing without interpreting preserves the line a later reasoner needs to stay honest.

  • Keep AI behind a priced, capped, deliberately-unwired transport, and leave the interpretation core un-architected on purpose.

    There is no point shipping quantities before a credible world model exists to ground them. Wiring the model only once a verification spine can check its claims keeps the AI subordinate to evidence rather than the other way around.

  • Delete the team's own prior, more-sophisticated deterministic semantic pipeline after documenting that it was semantically mute on 12 of 16 real sheets and rode on one-sample-tuned multipliers.

    Sophistication that does not generalize is a liability, not an asset. Choosing generality over sunk cost — with the failure evidence written down rather than hidden — is the whole thesis of the project made concrete.

What I built

  • Built the exact-CAD extraction substrate over DXF via ezdxf: expands nested INSERT/MINSERT blocks into world-space primitives with full ancestry and persistent-handle provenance, applies OCS-to-WCS transforms, and derives content-based IDs stable across re-extraction.
  • Enforced the core design law with a G2 AST gate (unittest) that fails the build if a door/window/room identifier appears in foundation code, so element vocabulary always originates from the project's own schedules and tags.
  • Built a content-hashed ingestion boundary that types every delivered file by evidence tier (delivered source / format-converted derivative / degraded failed-conversion / unsupported-but-preserved), links DWG-to-DXF conversions as provenance, and surfaces corrupt drawings instead of dropping them.
  • Added a non-resolving reference census that marks each declared image, underlay, XREF, and font present or missing — on one real sheet it surfaced 21 declared external images whose paths point outside the package, all correctly flagged as missing rather than assumed present.
  • Built dimension_evidence, the first primitive of a verification spine: reads each dimension's true geometric measured value (via ezdxf get_measurement, not the often-absent stored value), measured span, explicit text-override semantics, and style precision as exact, id-addressable evidence.
  • Kept AI behind a verified boundary: a priced, capped transport where an unpriced model is a constructor error and caps are enforced pre- and post-call, intentionally unwired because the interpretation core is deliberately unbuilt.
  • Wrote decision records and a known-gaps register that separate verified, evidence-cited facts from assumptions and document exactly where the substrate still degrades or drops data.
  • Regression-tested an R0 hardening pass that fixed silent geometry misplacement from OCS/negative-extrusion handling and made primitive IDs survive re-extraction.

Outcomes

  • 51 tests / <2s Foundation test suite passes 51 tests in under 2s — framed explicitly as proving foundation integrity, not architectural accuracyDocumented · test suite
  • 766 / 766 Real-package dimension audit: every readable-sheet dimension yields a supported geometric measured value, with 13 explicit text-overrides surfacedDocumented · dimension audit
  • recovered Reference census surfaced load-bearing hidden context the prior ingest silently dropped (e.g. a sheet declaring 21 external images, all outside the package)Documented · reference census
  • 12 / 16 mute Made the disciplined call to delete a prior deterministic pipeline that was semantically mute on 12 of 16 real sheets, choosing generality over sunk costDocumented · decision records
  • by design The interpretation / quantity-takeoff layer remains deliberately unshipped — a documented product decision (no quantities before a credible world model), not a gapSelf-reported

Limitations & what's next

  • The interpretation core is deliberately unbuilt and un-architected: model perception, the model-to-substrate interface, and the honesty contract for accepted facts are open founder decisions, not solved problems.
  • Passing tests prove foundation integrity only — the system makes no claim of architectural or semantic accuracy, and the docs refuse to conflate the two.
  • The substrate still degrades on some inputs (failed conversions, unreadable sheets); every extracted count is paired with a coverage descriptor so 'can't read it yet' is never mistaken for 'not in the drawing'.
  • DWG is only accessible via out-of-band conversion, so the extraction quality is bounded by the converter until a first-party path exists.
  • This is a private, pre-product, research-phase foundation — not a shipping or revenue-generating product; the quantity-takeoff workflow it is meant to serve does not exist yet.

Get in touch

Have a workflow worth automating?

I build the AI systems that run it end to end — and I'm looking for the roles where that ships.

Get in touch