Specifications
Compiled List Format
The canonical compiled JSON rule format consumed by the ClearURLs runtime.
The compiled list format is the canonical runtime input of the ClearURLs core.
It is not meant to be hand-written. Human-edited rule catalogs should use the new rule format, then be compiled into this normalized JSON shape before they are passed to the runtime.
Goals
The compiled format exists to keep the runtime small and predictable:
- all defaults are already resolved
- all long-form and short-form rules have explicit ids
- all aliases are preserved
- all authoring shorthand is removed
- the runtime does not need YAML parsing or schema validation
Top-Level Shape
{
"id": "core",
"defaultActive": true,
"providers": []
}id: stable list identifierdefaultActive: default activation state of the whole listproviders: compiled providers of the list
Provider Shape
{
"providerId": "google",
"urlPattern": "^https?:\\/\\/(?:[a-z0-9-]+\\.)*google(?:\\.[a-z]{2,}){1,}",
"defaultActive": true,
"completeProvider": false,
"forceRedirection": true,
"methods": ["GET"],
"rules": []
}providerId: stable provider identifier within the listurlPattern: canonical provider matcher sourcedefaultActive: default activation state of the providercompleteProvider: block the whole request when the provider matchesforceRedirection: mark redirect results as forced redirectsmethods: optional HTTP method restrictionrules: all provider rules as one normalized list
Rule Shape
{
"id": "field-utm-source",
"aliases": ["legacy-utm-source"],
"kind": "field",
"section": "rules",
"match": "^utm_source$",
"flags": "i",
"action": {
"type": "remove"
},
"activeDefault": true,
"description": "",
"exceptions": [],
"requestTypes": "all",
"preprocessors": [],
"referralMarketing": false
}id: stable provider-local rule idaliases: optional legacy ids for persistent settings migrationkind:exception,field,raw, orredirectionsection: legacy-compatible logical rule sectionmatch: canonical regex source used at runtimeflags: canonical regex flags used at runtimeaction:remove,rewrite, orredirectactiveDefault: configured default activation statedescription: optional human-readable descriptionexceptions: rule-level exception regex sourcesrequestTypes:allor an explicit listpreprocessors: normalized preprocessor definitionsreferralMarketing: whether the rule is part of referral-marketing handling
Runtime IDs
The runtime namespaces compiled rule ids by list and provider:
listId::providerId::ruleIdFor example:
core::google::field-utm-sourceThese runtime ids are used by the catalog layer for persistent activation overrides.
Relationship to the Runtime
The runtime consumes compiled lists through two steps:
CatalogManagerloads one or more compiled lists, applies list/provider/rule activation state, deduplicates compatible providers, and builds an immutable active snapshot.ClearUrlsEnginecleans URLs against that active snapshot.
The runtime no longer reads YAML or legacy rule JSON directly.
Edit on GitLab
Last updated on