Skip to main content
Version: 0.1.0

Rule Catalog

The engine evaluates rules in a strict 5-phase order. The first matching rule determines the result.

Rule Model

A rule never applies globally without a context (except fallback and hard-deny, which use context *).

interface Rule {
id: string;
context: string | "*";
when: (signals: NormalizedSignals) => boolean;
decision: "ALLOW" | "DENY" | "ALLOW_WITH_LIMITS";
reason: string;
confidenceDelta: number;
}

Evaluation Order

  1. Fallback Rules — Insufficient signals → fail fast.
  2. Hard-Deny Rules — Critical risk → fail fast.
  3. Allow Rules — Full access based on merit.
  4. Allow-With-Limits Rules — Conditional / restricted access.
  5. Default Deny — No rule matched → DENY (Confidence: LOW).

Semantics: First-match wins. The engine returns immediately when a rule matches.


Phase 1: Fallback Rules (Signal Quality)

Checked first. Handles missing data.

IDConditionDecisionConfidence Δ
deny_no_signalssignalCoverage == 0DENY-100
limit_partial_signalssignalCoverage < 0.5ALLOW_WITH_LIMITS-30

Phase 2: Hard Deny Rules (Critical Risks)

Risk checks that apply globally (*).

IDConditionDecisionConfidence Δ
deny_spamspamRisk is HIGH or VERY_HIGHDENY-100
deny_low_social_trustsocialTrust < NEUTRALDENY-100
deny_critical_trusttrust == VERY_LOWDENY-100

Phase 3: Allow Rules (Positive Access)

Granting full access based on merit.

IDContextCondition (Summary)Confidence Δ
allow_strong_builderallowlist.generalbuilder is ELITE OR (builder ≥ EXPERT AND socialTrust ≥ HIGH)+30
allow_strong_creatorallowlist.generalcreator is ELITE OR (creator ≥ EXPERT AND socialTrust ≥ HIGH)+30
allow_high_trustallowlist.generaltrust ≥ HIGH AND socialTrust ≥ HIGH+25
allow_comment_trustedcommenttrust ≥ NEUTRAL AND socialTrust ≥ NEUTRAL+15
allow_publish_verifiedpublishtrust ≥ HIGH AND socialTrust ≥ HIGH AND (builder/creator ≥ BUILDER)+25
allow_apply_qualifiedapplytrust ≥ NEUTRAL AND (builder/creator ≥ EXPERT)+20
allow_governance_votegovernance.votetrust ≥ HIGH AND socialTrust ≥ NEUTRAL AND recencyDays ≤ 30+20

Phase 4: Allow With Limits (Conditional Access)

Granting restricted access.

IDContextCondition (Summary)DecisionConfidence Δ
probation_inactiveallowlist.generaltrust ≥ NEUTRAL AND recencyDays > 14ALLOW_WITH_LIMITS-10
probation_new_userallowlist.generaltrust ≥ NEUTRAL AND socialTrust ≥ NEUTRAL AND builder=EXPLORER AND creator=EXPLORERALLOW_WITH_LIMITS0
probation_mixed_signalsallowlist.generaltrust ≥ HIGH AND socialTrust ≥ LOWALLOW_WITH_LIMITS-10
limit_comment_newcommenttrust ≥ LOW AND signalCoverage ≥ 0.5ALLOW_WITH_LIMITS-5
limit_publish_unverifiedpublishtrust ≥ NEUTRAL AND socialTrust ≥ NEUTRALALLOW_WITH_LIMITS-10
limit_governance_inactivegovernance.votetrust ≥ HIGH AND recencyDays (30-90]ALLOW_WITH_LIMITS-15

Phase 5: Default Deny

If no rule matches, the decision is DENY (Confidence: LOW).