Skip to content

Generator × Asset × Locale × Repo Matrix

This is the combination contract: every generator type, every data-source (asset) kind, their locale behaviour, their tier, the cross-cutting features they support, and every way they can be split across repositories. If a combination appears here, the architecture commits to supporting it.

Status: this documents the target design surface — the contract the engine and the OSS runtimes implement against. Build progress lives in the repo's BUILD-LOG.md, not here.

The unified model in one breath

  • Everything is a generator. The "seven types" are first-party generators, not a closed enum — the set is open (see Generator Types).
  • Data is an asset, not code. Lists are JSON, models are the portable .ngram binary. A generator references an asset; it never embeds language data.
  • Locale is a resolution axis, not an identity. An asset has one scoped name (@phony/person:first_names); tr_TR / en_US / de_DE are contributions to it, resolved through the domain > locale > base chain.
  • Three tiers preserve cross-runtime determinism. Tier 0 primitive kernel (native in every runtime), Tier 1 composition (pure data + PEL), Tier 2 WASM (rare imperative escape hatch).
  • Distribution is open. Any package can contribute generators, assets, or locale data; the main generator stays fixed while third parties add locales in separate data-only repos.

Legend: 🌍 multilingual (locale-bound asset) · ⚪ universal (locale-independent) · ➖ no data source


1. Generator catalog (all types, all variants)

TypeVariants / algorithms / modesData bindingLocaleTier
Logicuuid_v4 uuid_v7 ulid nanoid int_between float_between boolean datetime_between date_between time_between timestamp sequence gaussian exponential➖ algorithm0
Listsimple · weighted · object-with-metadataasset or inline🌍 or0 + asset
Model (N-gram)word sentence text paragraph poem acrostic real_word.ngram asset🌍0 + asset
Templatesingle pattern · weighted variants · operationsreferences + own variant patterns🌍 when refs/patterns are1
Statisticalcategorical continuous algebraic multivariate; distributions normal lognormal exponential uniform poisson beta gamma; differential_privacy (laplace/gaussian/exponential)inline params; categorical weights may be locale/domain⚪ mostly; weights may be 🌍0 distributions · 1 algebraic/multivariate
Linkedgeo · person · financial · productlinked multi-column asset or rulesgeo/person 🌍 · financial ⚪1 + asset
Event Sequencebase after delay probability distribution condition➖ chronology1

Key invariant: locale-dependence is a property of the asset a generator binds to, not of the generator type. The same list generator is 🌍 with cities and ⚪ with http_methods. For template, the "data source" is its locale-scoped variant patterns (Turkish address format ≠ French), not a file.


2. Cross-cutting feature matrix (all features)

Which feature applies to which generator type.

FeatureLogicListModelTemplateStatisticalLinkedEvent Seq
Weighted selectionvariant weights✓ categorical
Constraints (min/max length, prefix)rangemin/max
unique modifier
nullable modifier✓ (optional events)
transform (PEL post-op)✓ (operations)
Consistency (table/entity/global)
FPE for PK/FK✓ (keys)
Linking participation✓ (is)
Differential privacy
locale_independent opt-out(rarely)dependsfinancial

All generators flow through the same uniform envelope {use, params, constraints, modifiers}, so the modifier pipeline (unique / nullable / transform) is available to every type without each reinventing it.


3. Data source (asset) catalog

🌍 Multilingual assets — one scoped name, many locale contributions

Asset kindExamples (logical names)Format
Model (.ngram)person.first_names person.last_names person.full_names business.company_names address.street_names usernames product_names slogansportable binary
Listgeo.cities geo.districts geo.neighborhoods geo.regions person.titles person.suffixes address.street_suffixes address.building_types commerce.*JSON array
Template (patterns)person.full_name address.street_address address.full_address contact.phone contact.emailpattern set
Linked (multi-column)geo.locations (city+district+country+postal+coords+phone_prefix+currency) person.names_with_genderJSON records

⚪ Universal assets — never multilingual

Asset kindExamples
List (standards)internet.http_methods http_status_codes mime_types tlds · standards.iso_countries iso_currencies iso_languages timezones · tech.file_extensions protocols
Noneall Logic, all Event Sequence, Statistical distributions, Linked.financial (pure math)

Combination space: every 🌍 asset × {tr_TR, en_US, de_DE, fr_FR, az_AZ, …}. The asset is one extension point; each locale is an independent contribution to it.


4. Master combination matrix

For each generator, which data-binding modes it allows, its locale behaviour, its tier, and which repo-distribution patterns (§5) can carry it.

GeneratorInlineAssetRefsNoneLocaleTierRepo patterns
Logic0A, C
List (universal)0A, C, D
List (multilingual)🌍0B, D, E, F, G, H
Model🌍0B, D, E, F, G, H
Template✓ (patterns)🌍/⚪1B, C, D, F, H
Statistical (dist)0A, C
Statistical (categorical)✓ (weights)⚪/🌍0A, C, E, H
Statistical (algebraic/mv)1A, C
Linked (geo/person)🌍1B, D, E, F, G, H
Linked (financial)✓ (rules)1A, C
Event Sequence1A, C

5. Repo-distribution patterns

Every legitimate way generators and assets split across repositories.

#PatternHoldsReposExample
ABase packagelocale-independent generators + universal lists1 (no locale variants)@phony/base
BMonolithic locale packageone language's models + lists + templates + defs1 per locale@phony/tr_TR
CDataless generator packagepure logic / event / statistical / algorithmic defs — no assets, works in every locale1, any author@x/isbn @x/tckn @x/event-seq
DGenerator + bundled default assetsdeclares an asset extension point + ships some locales1@phony/coin (def + de/en)
EData-only contribution packageonly assets; adds locale data to an asset defined elsewhere; no code1@alice/coin-trnl@phony/coin:coin.flip (tr/nl)
FConcept split within a localeparts of one language in separate reposN per locale@phony/tr_TR-names -geo -address
GLocale split for one concepta concept's languages in separate repos (contributors)N per concept@phony/coin + @x/coin-de + @y/coin-tr + @z/coin-nl
HDomain overrideinherits a locale, overrides/adds, usually private1@company/internal@phony/tr_TR

Distribution form by tier (orthogonal to the above):

  • Tier 1 (data / PEL) — composition generators + assets. Run natively in every runtime, no engine. This is the default for third-party generators.
  • Tier 2 (WASM) — genuinely imperative generators. Authored in any WASM-targeting language; the artifact is .wasm, not source. Runs anywhere a WASM engine is present (PHP is the weak runtime — see Execution Model).
  • Language-native (Rust-only) artifacts are not a distribution form — they would only run in one runtime, breaking portability.

6. Worked example — person.first_name across locales and repos

Generator definition:   first_name = { use: model, source: @phony/person:first_names }
                        → defined once, never changes, blind to the locale axis

Asset extension point:   @phony/person:first_names    (scoped, locale-polymorphic)

Locale contributions (may live in different repos):
  ├─ @phony/tr_TR        → first_names.ngram (tr)        [pattern B or F]
  ├─ @phony/en_US        → first_names.ngram (en)
  ├─ @phony/de_DE        → first_names.ngram (de)
  └─ @aziz/az-names      → first_names.ngram (az)         [pattern E: 3rd-party, data-only]

Resolution (locale = az):  domain > locale > base chain → @aziz/az-names contribution
Determinism:               each (asset, locale) is independent → adding az never
                           changes tr / en / de output

This single example exercises all four axes at once: generator (fixed) × asset (scoped) × locale (resolution axis) × repo (open contribution).


7. Invariants the matrix guarantees

  1. Portability — any supported combination produces byte-identical output in Rust, PHP, JS, Python, and Go, given the same seed (SplitMix64 + derive_seed
    • portable .ngram + JSON assets).
  2. Open locales — any 🌍 asset can gain a new locale from a separate data-only repo, without touching the generator that consumes it.
  3. Determinism isolation — each (asset, locale) and each cell (seed, field_path, row) is independent; adding generators, assets, or locales never perturbs existing output.
  4. Uniform features — the modifier pipeline and consistency/FPE apply across types through the one envelope; no feature is locked to a single generator.
  5. Safe by construction — Tier 1 contributions are pure data; Tier 2 is sandboxed WASM. Installing a community generator cannot run code on your machine.

Phony Cloud — Documentation & Specification