{ "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://fablepool.org/schemas/module.schema.json", "title": "FablePool Userland Module Configuration", "description": "A userland module instantiates the constitutional kernel (kernel/constitution.md) for a specific polity by overriding the parameters defined in spec/parameter-registry.md and adding substantive userland rules. Omitted parameters inherit kernel defaults (Art VII). Schema bounds encode kernel floors/ceilings; cross-field constraints listed in the registry's 'textual constraints' section are validated by the test harness, not this schema.", "type": "object", "required": ["module", "polity", "parameters"], "additionalProperties": false, "properties": { "module": { "type": "object", "required": ["name", "version", "kernelVersion"], "additionalProperties": false, "properties": { "name": { "type": "string", "pattern": "^[a-z0-9][a-z0-9-]{1,63}$", "description": "Machine identifier for this module." }, "version": { "type": "string", "pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(-[0-9A-Za-z.-]+)?$", "description": "Semver of this module configuration." }, "kernelVersion": { "type": "string", "description": "Semver range of the kernel this module targets, e.g. '^0.1'." }, "description": { "type": "string" }, "maintainers": { "type": "array", "items": { "type": "string" }, "minItems": 1 }, "license": { "type": "string" } } }, "polity": { "type": "object", "required": ["name", "scale"], "additionalProperties": false, "properties": { "name": { "type": "string", "minLength": 1 }, "scale": { "type": "string", "enum": ["household", "community", "organization", "network", "polity"], "description": "Order-of-magnitude class of the polity; advisory, used by the test suite to select scenario families." }, "expectedMembers": { "type": "integer", "minimum": 2 }, "description": { "type": "string" } } }, "parameters": { "type": "object", "additionalProperties": false, "description": "Kernel parameter overrides. Every key maps to a row in spec/parameter-registry.md.", "properties": { "suffrage": { "type": "object", "additionalProperties": false, "properties": { "criteria": { "type": "array", "items": { "type": "string", "minLength": 1 }, "minItems": 1, "description": "Citizenship admission criteria (Art II)." }, "minimumAge": { "type": ["integer", "null"], "minimum": 0, "description": "Minimum voting age; null means capacity-based per Art II." }, "onboardingWaitDays": { "type": "integer", "minimum": 0 }, "proxyVoting": { "type": "boolean" }, "exitGraceDays": { "type": "integer", "minimum": 0 } } }, "voting": { "type": "object", "additionalProperties": false, "properties": { "method": { "type": "string", "enum": ["majority", "approval", "ranked", "consent", "score"] }, "weighting": { "const": "equal", "description": "Fixed by the Art V equal-suffrage invariant. Present in configs only for explicitness." }, "secretBallot": { "type": "boolean" }, "tieBreak": { "type": "string", "enum": ["status-quo", "random", "second-round"] }, "defaultPeriodDays": { "type": "integer", "minimum": 1 } } }, "quorum": { "type": "object", "additionalProperties": false, "properties": { "base": { "$ref": "#/$defs/fraction" }, "escalated": { "$ref": "#/$defs/fraction" }, "adaptiveDecay": { "type": "object", "required": ["enabled"], "additionalProperties": false, "properties": { "enabled": { "type": "boolean" }, "halvingPeriodDays": { "type": "integer", "minimum": 1 }, "floor": { "$ref": "#/$defs/fraction" } } } } }, "amendment": { "type": "object", "additionalProperties": false, "properties": { "proposalSponsors": { "type": "integer", "minimum": 1 }, "reviewPeriodDays": { "type": "integer", "minimum": 1 }, "votingPeriodDays": { "type": "integer", "minimum": 1 }, "cooldownDays": { "type": "integer", "minimum": 0 }, "thresholds": { "type": "object", "additionalProperties": false, "properties": { "patch": { "type": "number", "minimum": 0.5, "maximum": 1 }, "minor": { "type": "number", "minimum": 0.5, "maximum": 1 }, "major": { "type": "number", "minimum": 0.667, "maximum": 1, "description": "Kernel floor (Art III): kernel-major changes require at least two-thirds." } } } } }, "fork": { "type": "object", "additionalProperties": false, "properties": { "assetSplitRule": { "type": "string", "enum": ["pro-rata", "negotiated", "none"] }, "minimumFaction": { "type": "number", "exclusiveMinimum": 0, "maximum": 0.5, "description": "Kernel ceiling (Art VI): a fork may never require more than half the polity." }, "noticePeriodDays": { "type": "integer", "minimum": 0 } } }, "emergency": { "type": "object", "additionalProperties": false, "properties": { "enabled": { "type": "boolean" }, "declarationAuthority": { "type": "string", "enum": ["designated-steward", "council", "supermajority-snap-vote"] }, "maxDurationDays": { "type": "integer", "minimum": 1, "maximum": 90, "description": "Kernel ceiling (Art VIII)." }, "renewalThreshold": { "type": "number", "minimum": 0.5, "maximum": 1 }, "autoSunset": { "const": true, "description": "Fixed by Art VIII. Present in configs only for explicitness." }, "suspendableScopes": { "type": "array", "uniqueItems": true, "items": { "type": "string", "enum": ["userland-rules", "spending-limits", "scheduling"] }, "description": "Suffrage, invariants, the amendment process, and the fork right are never suspendable (Art VIII); hence absent from this enum." } } }, "disputes": { "type": "object", "additionalProperties": false, "properties": { "forum": { "type": "string", "enum": ["full-vote", "council", "jury", "external-arbiter"] }, "jurySize": { "type": "integer", "minimum": 3 }, "selectionMethod": { "type": "string", "enum": ["sortition", "election", "rotation"] }, "termDays": { "type": "integer", "minimum": 1 }, "appealTo": { "type": "string", "enum": ["full-vote", "none"] } } } } }, "userland": { "type": "object", "additionalProperties": false, "properties": { "rules": { "type": "array", "items": { "type": "object", "required": ["id", "title", "text"], "additionalProperties": false, "properties": { "id": { "type": "string", "pattern": "^[a-z0-9][a-z0-9-]*$" }, "title": { "type": "string", "minLength": 1 }, "text": { "type": "string", "minLength": 1, "description": "The substantive rule. Subordinate to the kernel (Art VII); may add obligations, may not subtract from Art V invariants." }, "params": { "type": "object", "description": "Free-form parameters local to this rule." }, "tests": { "type": "array", "items": { "type": "string" }, "description": "Names of adversarial scenarios (Milestone 2) that exercise this rule." } } } } } } }, "$defs": { "fraction": { "type": "number", "exclusiveMinimum": 0, "maximum": 1 } } }