Constitutional Evolution

daitai may evolve. But daitai must not erode.

This document defines how the daitai constitution, language, algebra, runtime models, and AI-collaboration rules may change while preserving the identity of the system. Evolution is permitted only when it increases expressive power without increasing hidden semantic entropy.

Core principle

A change is valid only if it preserves the ability for humans and AI to reason about the system from the same explicit rules. If a change makes daitai harder to simulate, verify, transform, or explain, it is suspect.

The positive constitution

daitai must preserve:

  • determinism by default
  • explicit non-determinism
  • value semantics
  • immutability in the core
  • pure functions and transformations
  • explicit static types
  • algebraic composition
  • local reasoning
  • rewrite compatibility
  • backend independence
  • semantic clarity over convenience
  • constraints before escape hatches

These are constitutional invariants. They may be generalized, but not silently weakened.

The immune system

A proposed change must be rejected if it introduces:

  • hidden mutable state
  • implicit side effects or non-determinism
  • global state
  • untyped or weakly typed behavior
  • semantic ambiguity
  • implementation-specific leakage into the core
  • uncontrolled reflection or metaprogramming
  • exceptions as control flow
  • lifecycle behavior
  • order-dependent semantics not visible in the syntax
  • features that cannot be locally reasoned about
  • features that cannot be tested deterministically
  • features that require trust instead of verification

Admissibility test

A proposed change C is admissible only if it passes all seven tests:

  1. Determinism — preserves same input → same output (or makes non-determinism explicit, typed and isolated).
  2. Local reasoning — a reader understands the behavior without inspecting global context or hidden lifecycle.
  3. Reduction — reduces to existing core semantics, or introduces a clearly defined new primitive with laws.
  4. Rewrite — participates in rewrite rules without changing meaning.
  5. Backend independence — is defined independently of TypeScript, Swift, WASM, CUDA, JAX, browser APIs, OSes, or vendor runtimes.
  6. AI alignment — both human and AI can apply C from the written rules without relying on taste or hidden project knowledge.
  7. Entropy — reduces or holds semantic entropy. Entropy-increasing changes must be rejected or moved outside the core.

Layers of change

| Layer | Scope | Cadence | |-------|-------|---------| | 0 — Identity | determinism, explicitness, value semantics, algebraic reasoning, local reasoning, separation of semantics and execution | almost never | | 1 — Core algebra | types, expressions, functions, classes as product types, interfaces as sum types, Result, Optional, Step, Time, Constraint, Rewrite | slowly, with formal laws | | 2 — Derived constructs | syntactic sugar, derived operators, standard library, common patterns | normally; must reduce to layer 1 | | 3 — Tooling and backends | compilers, renderers, IDEs, AI tools, GPU/WASM/Swift/TypeScript backends, storage formats | freely; must not redefine core semantics |

Versioning rule

  • Patch — no semantic change (wording, diagnostics, docs, compiler bug fix).
  • Minor — adds expressiveness without breaking existing meaning.
  • Major — changes core semantics or removes a previously valid construct. Requires: migration path, explicit rationale, invariant analysis, compatibility statement, rejected alternatives.

Final law

When in doubt, choose the simpler rule. When still in doubt, reject the change. A missing feature is better than a corrupted core. daitai evolves by becoming more precise, not more permissive.