THE LATCH FIELD MANUAL

KNOW WHAT
THE SWITCH
MEANS.

The exact local evaluation model, its boundaries and its limits.

ONE PATH TO A BOOLEAN.

Latch first validates the configuration. Invalid settings return false with an explanation. A disabled master switch returns false before targeting or rollout. When enabled, every targeting condition must match. A non-empty fictional subject ID is then required for the deterministic rollout gate.

This is one AND group followed by one percentage gate. It is not a full implementation of another feature-flag platform, and it does not support multiple OR strategies, variants, SDK evaluation or remote context.

valid configuration → enabled → all conditions → stable subject → bucket < threshold

MAKE THE COMPARISON EXPLICIT.

Plan and country use case-sensitive string comparisons: equals, does not equal, or is one of a comma-separated list. List values are trimmed, and empty entries are ignored. A missing string attribute fails even a does-not-equal condition.

Beta status requires an actual boolean. The text “true” is not the boolean true. Account age requires a finite number and supports inclusive at-least and at-most comparisons. Latch does not coerce a context string into a number.

The editor accepts at most five conditions. With no conditions, every valid subject reaches the rollout gate. Condition order changes the trace order but not the AND result.

THE BUCKET STAYS PUT.

Latch uses its own small demonstration algorithm: UTF-8 FNV-1a, with a 32-bit unsigned result. It hashes the flag key, a null separator, and the subject ID after trimming surrounding whitespace. Case remains significant. The environment name is deliberately excluded.

hash = FNV1a32(flagKey + "\0" + subjectId.trim())
bucket = floor(hash / 2^32 × 10000)
threshold = percentage × 100
included = bucket < threshold

Buckets range from 0 through 9999. The percentage is a whole number from 0 through 100. This is not Unleash's MurmurHash algorithm or an SDK compatibility promise. FNV-1a here is deterministic, not cryptographic.

THE EDGE IS PART OF THE RULE.

At 0%, threshold is zero and no bucket is included. At 100%, threshold is ten thousand and every valid bucket is included. A bucket exactly equal to the threshold is excluded. Bucket 4999 is included at 50%; bucket 5000 is not.

For new-navigation and sample-001, the local bucket is 1285. With matching conditions, 12% excludes it because 1285 is not below 1200. At 13%, it is included because 1285 is below 1300. The subject has not moved; the threshold has.

Increasing a percentage cannot remove an already included subject when the flag key, subject and conditions stay the same. A small sample cohort does not have to contain exactly the configured percentage.

Try the 12% / 13% boundary ↗

THREE LABELS. ZERO CONNECTIONS.

Lab, Staging and Release are simulated environments in local data. Each flag has independent settings for each label. Editing one does not change the others. The comparison page uses the same fictional context and saved configurations to show their differences.

No SDK key, account, network endpoint, production connection or deployment exists. Exported JSON is a Latch simulation document, not a configuration ready to paste into a real service.

KEEP THE WORKING VISIBLE.

The rule bench can evaluate the current draft before it is saved. The result identifies whether it used saved settings or an unsaved draft. Save local configuration persists only valid settings. Reload saved settings discards the current draft.

Local storage contains the known flag configurations, selected simulation and last fictional context. Malformed stored settings fall back to the corresponding sample configuration. Exports contain these local examples and an explicit simulated-only marker.

Restoring sample configurations returns the workspace to its original state. No remote action, notification or production change is performed at any point.

Open the local workspace ↗