Blocks
Core Concepts

Core Concepts

Core Concepts

Blocks treats domain concepts as first-class, executable artifacts — inspired by Cube.dev, Malloy, and PDDL.

The Three Pillars

Entities

Entities are the "things" in your domain.

domain:
  entities:
    user:
      fields: [id, name, email, created_at]
    resume:
      fields: [basics, work, education, skills]

Reference entities using entity.<name>:

blocks:
  my_block:
    inputs:
      - name: user
        type: entity.user

Signals

Signals are domain-specific concepts to extract or calculate.

domain:
  signals:
    engagement:
      description: "How engaged is the user?"
      extraction_hint: "Based on activity frequency and recency"
    readability:
      description: "Clear visual hierarchy and typography"

Signals guide AI validation and give semantic meaning to data.

Measures

Measures are constraints on output values.

domain:
  measures:
    score_0_1:
      constraints:
        - "Value must be between 0 and 1."
        - "Higher values indicate stronger signal."
    semantic_html:
      constraints:
        - "Use semantic tags (header, main, section)"
        - "Proper heading hierarchy (h1 → h2 → h3)"

Reference measures in outputs:

blocks:
  my_block:
    outputs:
      - name: score
        measures: [score_0_1]

Why Domain Modeling Matters

Without domain modeling:

  • Developers hallucinate structures
  • Conventions drift over time
  • Semantic meaning is lost in code
  • No consistency across blocks

With domain modeling:

  • ✅ Explicit semantics
  • ✅ Drift detection when changes occur
  • ✅ Evolutionary design through negotiation
  • ✅ Humans and AI agents maintain alignment through validation

Next Steps