Skip to main content

Documentation Index

Fetch the complete documentation index at: https://code4source.mintlify.app/llms.txt

Use this file to discover all available pages before exploring further.

The playground is a visual environment where you can author and test rulesets without writing JSON by hand. It pairs a map with a graph-based builder, so you can draw a polygon, drop nodes onto a canvas, connect them, and see the verdict on the same screen.

At a glance

The playground splits the screen into three areas:
Playground layout: map on the left, builder canvas in the center, results panel on the right
  1. Map — draw or paste a geometry. It becomes the $input to every set anchored on it.
  2. Builder canvas — the visual ruleset. Each node is a set, projection, check, or verdict; edges represent references (e.g. a check pointing at a set).
  3. Panel — the live Run button, the JSON view, the verdict and evidence after each run.

Authoring loop

The typical authoring loop:
  1. Draw a polygon on the map (or paste GeoJSON).
  2. Pick a starting point — either an empty canvas or a template.
  3. Add nodes from the palette and connect them.
  4. Click Run to evaluate against the polygon.
  5. Inspect the verdict and per-check evidence.
  6. Iterate.

The palette

The sidebar palette holds the node kinds you can drop onto the canvas:
Builder palette with the five node kinds
NodeWhat it produces
source_setA set anchored on a spatial source (e.g. br:icmbio:conservation-units).
subject_setA set anchored on a subject register (e.g. ofac:sdn).
setop_setA set built from union / intersection / difference of other sets.
projectionA scalar or geometric value computed over a set (count, total_area_m2, …).
checkA boolean predicate with a severity. Feeds the verdict.
Drop a node, then click it to open its editor in the right sidebar.

Editors

Every node has a typed editor. The editor enforces the same rules that the API enforces — invalid configurations are flagged before you run.
Source set editor: source picker, join op, target, optional filter
For a source_set, you pick:
  • The source from the catalog (auto-suggested via GET /v1/sources).
  • The joinintersects, dwithin, contains, within, disjoint, subject_match.
  • The target$input or another set in the graph.
  • An optional filter (e.g. temporal, property-equals).
For a check, you pick:
  • The severitycritical, high, medium, low, info.
  • The predicateexists (set non-empty) or threshold (referenced projection passes a comparison).

Connecting nodes

Drag from a node’s output handle to another node’s input. The builder rejects connections that would create cycles or that mismatch types.
Two source sets feeding into a setop set, which feeds into a check

Run and inspect

Click Run in the topbar to evaluate the canvas against the current map geometry. The panel updates with:
  • The top-level status (ok / degraded) and outcome (compliant, warning, non_compliant, degraded).
  • Each check: triggered, severity, evidence list.
  • Each projection: computed value.
Result panel showing a non_compliant outcome with evidence highlighted on the map
Evidence features are highlighted on the map so you can see exactly which polygons drove the verdict.

JSON view

Every visual edit syncs both ways with a JSON document. Click Show JSON to open the modal — copy the body to use directly with POST /v1/evaluate, or paste in a ruleset to load it into the canvas.
JSON modal showing the canonical ruleset body

Templates

The sidebar offers ready-made starting points covering common patterns:
TemplateWhat it shows
overlap_ratio_tiersTiered checks on overlap ratios (majority vs partial overlap).
distance_tiersDistance-based severity tiers (very close / close / far).
distance_bandMatch features in a [min, max] distance band.
chained_setsOne set joined against another set instead of $input.
dynamic_buffer_appA buffer whose distance is read from a feature property.
merged_hazard_zonemerge projection unifying a set’s geometries into a hazard layer.
temporal_recencyFilter to features newer/older than a relative window.
multi_joinMultiple sources in a single ruleset.
Templates load into the canvas; from there you adapt names, sources, severities, and thresholds to your policy.

When to use the builder vs raw JSON

  • Builder: exploring policies, demoing to stakeholders, authoring a first version visually before reviewing.
  • Raw JSON: editing a stored ruleset programmatically, code review on a PR, automated generation from a higher-level config.
The two are interchangeable — the JSON view is canonical and the builder is just a renderer over it.