name: synthetic-data
description: Entry point for synthetic data — `pulse synth from-schema` vs `pulse synth from-profile` (CLI + library; no MCP tool), the spec shape, the distribution registry, the determinism rule, and which focused synth skill answers each question.
type: guide
kind: design
applies_to: inspect, predict, manifest
covers: [synth from-schema, synth from-profile, profile create, synth, distributions, correlations, models, determinism]
requires: [capability:synth]
Synthetic data
Pulse synthesizes deterministic .pulse cohorts. No MCP tool runs synth: an MCP-only agent can author the spec but not run it; hand it to the CLI or Pulse.Synth:
pulse synth from-schema -s spec.json -o out.pulse --seed 42 [--rows N] [--json]
This is the CONTRACT surface: rules whose violation is SILENT (measurements: docs/src/cli/synth-calibration.md). Synth writes a .pulse file, never Response.Components.
Which skill answers what
| Question | Skill |
|---|---|
What does profile create capture; what does each field rebuild as? | synth-profile-capture |
Why packed_bool → bernoulli, small integer → discrete? | synth-marginals |
set_* (multi-select) profiling, pairs, generation | synth-set-fields |
correlations: which marginals / types may join | synth-correlations |
| Two relationships name one field — which wins? | synth-conflicts |
Several drivers conditioning one numeric (--fit-models) | synth-models |
Gating, masking, deriving a field, reading earlier rows (rules[], constraints[], lag) | synth-structural-rules |
Drawing in a rule (uniform(), bernoulli(p)); helper fields ("output": false) | synth-rule-draws |
The _synthetic top-up and --fidelity-report | synth-fidelity-report |
| How close a twin is to real rows (disclosure) | synth-disclosure-report |
| Byte-identical output; why a profile can drift | synth-determinism |
--fit-shape mixtures | synth-shape-fit |
datetime: local hours / weekdays, per-row zones, DST, trends / seasons / windows | synth-datetime |
| One distribution’s params | atomic op-synth-<kind> |
Two modes
| Mode | Input | When |
|---|---|---|
pulse synth from-schema | hand-written JSON spec | caller knows the shape — fixtures, CI seeds, demos |
pulse synth from-profile | profile JSON + the source cohort it was captured from | tagged top-up: add rows matching a real cohort’s marginals, source untouched |
Privacy. A profile-derived twin is NOT differentially private and carries NO formal privacy guarantee: no noise is added, so a row can repeat a real one and the profile leaks rare categorical values, percentile ranges and coefficient structure. The disclosure section (exact-match rate, DCR) is an audit aid, not a guarantee.
Schema-mode spec
{
"row_count": 100000,
"fields": [
{"name": "user_id", "type": "u64", "distribution": "monotonic_from", "params": {"start": 1}},
{"name": "age", "type": "u8", "distribution": "normal", "params": {"mean": 35, "std": 12}},
{"name": "country", "type": "categorical_u8", "distribution": "weighted_categorical", "params": {"values": ["US","UK"], "weights": [0.6,0.4]}},
{"name": "amount", "type": "f64", "distribution": "lognormal", "params": {"mu": 4.2, "sigma": 0.8}}
],
"constraints": [{"expr": "amount >= 0"}],
"max_rejection_rate": 0.5
}
Strict: spec, rules file and profile refuse an unknown key or a params key the distribution does not read (rate → lambda): PULSE_REQUEST_UNKNOWN_FIELD, details.path, a suggestion.
constraints[] (reject-and-redraw) and rules[] (gate, mask, derive): read synth-structural-rules before a spec gates, masks or derives a field.
Distribution registry
Registry: the manifest’s synth_distributions; params and clamp semantics per kind in op-synth-<kind>.
uniform [min,max) · normal (optional min/max clamp) · lognormal · exponential · poisson · pareto · bernoulli · monotonic_from (ignores RNG — primary keys) · weighted_categorical (uniform when weights absent) · uniform_date (inclusive both ends) · uniform_datetime (zoned local time) · regex (no backreferences) · mixture (≥2 components; bimodal or skewed shapes a single normal collapses).
Three carry rules you cannot guess:
discrete—valuesstrictly ASCENDING + optionalweights. The exact per-level histogram of an integer field; whatprofile createreconstructs every capped integer field from (synth-marginals).constant— coerced ONCE at spec parse to the field’s ROW shape: bool → 1/0 on a scalar, option-name array or object → aset_*mask, string REQUIRED for a categorical, verbatim exact string fordecimal128(ParseDecimal128). A shape the row cannot hold is refused at parse.set_bernoulli—optionsalso PRE-REGISTERS the field’s dictionary at schema-build time. A determinism requirement, not an optimisation (synth-set-fields).
Every field type is reachable. A vector (vec_f32 / vec_f64) needs a vector block and is ONE joint draw, never dim scalars: vector-fields. decimal128 takes field-level precision / scale (banker’s rounding). Bit-packed (u4, packed_bool) take one whole byte per field in the row. nullable: true opts into the null bitmap; nulls NEVER ride an inline sentinel.
Determinism contract
Same (spec, opts.Seed, lookup() tables) MUST produce a byte-identical .pulse file; same (--input, --seed) MUST produce a byte-identical profile document. Seed splitting, Seed == 0, null-draw order, map-order folds and float fusion: synth-determinism.
Gotchas
Pulse.Synth/Pulse.Profileuse the instance filesystem (afero.NewMemMapFs()to test).monotonic_fromcounts ACCEPTED rows: no gaps.- A model coefficient is latent-scale (data units only when
Qisnormal); a quantized modelled target attenuates at write time —synth-models. --fit-modelsdoes not imply--residual-correlations, and neither implies--conditional.--fit-shapecomposes with all of them.
See
- The focused skills in the table above, plus atomic
op-synth-<kind>. cohort-schema-design— field types, dictionaries, null bitmap.regression-modeling— the OLS engine both model capture and the recovery refit drive.pulse_errors_lookup—PULSE_SYNTH_*/PULSE_PROFILE_*recovery.