Skip to content

Examples & Contracts

This section covers practical usage scripts and formal DSL contracts.

DSL Contracts (tests/contracts/dsl.contract.test.mjs)

Contract tests ensure DSL behavior remains stable:

  • path write/read boot behavior
  • fixed selectors ([1])
  • broadcast ([i]) with derivations
  • logical filters
  • range and multi-select
  • transform projections

Run:

bash
npm run test:contracts

Demo Scripts

FilePurpose
tests/Demos/Social_Graph.tsPointer-based social graph walkthrough
tests/Demos/ShopsExample.tsCollection + selectors + derivation example
tests/sand.tsSandbox/experimental script space

Run directly:

bash
node tests/Demos/Social_Graph.ts
node tests/Demos/ShopsExample.ts
node tests/sand.ts

When to Use Demos vs Contracts

  • Use demos to communicate capability and onboarding.
  • Use contracts to lock behavior and catch regressions.