Governance Layer is a pre-alpha research prototype. The theoretical framework has undergone five rounds of adversarial review; the reference implementation is under active construction. Contributions are welcome — open an issue first to discuss your idea, then follow the workflow below. Expect interface churn as the theory evolves.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/xcoder-es/governance-layer/llms.txt
Use this file to discover all available pages before exploring further.
All participants are expected to follow the project’s Code of Conduct, which is adapted from the Contributor Covenant v2.1. Harassment-free participation is a requirement, not a suggestion.
Contribution workflow
Open an issue
Before writing any code, open a GitHub issue to describe what you want to change. This is especially important for theoretical contributions — changes that touch the formal framework (parliament, contracts, identity layer) need discussion before implementation.
Fork and branch
Fork the repository and create a branch named after your issue:The convention is
issue-{number}-{short-description}.Make your changes
Follow the code standards described below. All public functions need type hints. No neural networks in governance code — the layer must remain fully algorithmic.
Test suite
Tests live intests/ and cover the core governance modules. The suite is intentionally varied — unit tests, integration tests, property-based tests, and fuzz tests are all present.
| File | What it covers |
|---|---|
test_committee.py | Seven parliament member implementations |
test_contracts.py | Ulysses Contract lifecycle and enforcement |
test_fuzz.py | Fuzz inputs to governance protocol boundaries |
test_identity.py | Identity Layer tiers, commitments, and vectors |
test_integration.py | Full speaker → parliament → identity pipeline |
test_property.py | Hypothesis-based property tests |
test_speaker.py | Speaker state machine transitions |
test_tee.py | Simulated TEE enclave and watchdog |
Property and fuzz tests
test_property.py uses Hypothesis to generate adversarial inputs automatically. test_fuzz.py applies structured fuzzing to the protocol boundaries. These tests are especially important for catching edge cases in the budget and veto logic that unit tests alone do not exercise.
CI pipeline
The GitHub Actions workflow (.github/workflows/tests.yml) runs on every push and pull request to main. It tests against Python 3.10, 3.11, and 3.12 in parallel.
Each matrix job:
- Checks out the code
- Installs
uv - Runs
uv syncto install all dependencies - Installs the package in editable mode with
uv pip install -e . - Runs the full test suite with coverage:
- Uploads the
.coverageartifact for inspection
Coverage configuration
Coverage is measured oversrc/governance with several directories excluded. The exclusions reflect intentional scope — these modules are either experimental scaffolding or UI code that requires a running service to test meaningfully.
Excluded from coverage measurement:
src/governance/experiments/*src/governance/benchmarks/*src/governance/dashboard/*src/governance/ontology/*src/governance/tee/*src/governance/dsl/*src/governance/prove/*- Selected identity extension files (
extension.py,keys.py,ontology.py,params.py) src/governance/runner.py
Code standards
Type hints
All public functions and methods must have complete type annotations. The CI does not currently enforce this with a linter, but PRs without type hints will be asked to add them.
No neural networks
Governance code must remain fully algorithmic — no
torch, no gradients, no learned parameters. The gradient barrier is a core property of the formal model.No inline comments
Let the code speak. Use docstrings for public APIs; do not add inline
# comments explaining what the code does.Import order
Standard library → third-party → local, with one blank line between groups. Follow this strictly to keep diffs clean.
Issue labels
| Label | Meaning |
|---|---|
bug | Something isn’t working |
enhancement | New feature or request |
documentation | Docs improvements |
good first issue | Good for newcomers |
testing | Test coverage |
research | Theoretical or experimental |
osf | OSF preregistration related |
book | Book chapter or appendix |
cleanup | Refactoring, technical debt |
meta | Process / project management |
Reporting bugs and theoretical issues
Open a GitHub issue for:- Bugs — unexpected errors, incorrect outputs, test failures
- Theoretical concerns — gaps in the formal model, counterexamples to stated properties, proposed changes to the parliament or contract formalism