The Moral Spectrum Analyzer — Geometric Ethics for Trustworthy AI: validation-gated, auditable multilingual content moderation.
Project description
Moral Spectrum Analyzer
Geometric Ethics for Trustworthy AI — an instrument that reads a moderation decision not as one scalar, but as a spectrum across nine (+1 discovered) moral axes, grounds every number in a cross-dataset-validated encoder, holds the verdict invariant under re-description, and emits a re-verifiable audit proof behind every decision. A worked instance of Philosophy Engineering.
Built for the Global Trust Challenge (2026). Domain: multilingual content moderation.
Current AI systems collapse a morally significant decision into a single number. That scalar can't say which value it acted on, drifts when you reword the same sentence, and — worst — can't tell you what it fails to see. The Moral Spectrum Analyzer decomposes the signal per moral axis, moderates where it is validated, escalates and discloses where it is not, and discovers the moral dimensions a fixed taxonomy is missing.
See CHARTER.md for the evaluated claims (each marked [demonstrated] / [committed])
and PLAN.md for the build plan and milestones.
What this is
A thin orchestration layer that composes two existing libraries — it does not fork them:
xbse— the perception layer: small per-dimension moral encoders, each cross-dataset validated by a shared, pre-registered gate.erisml-compiler— the DEME reasoning engine: natural language → 9-dimension moral tensor → contraction to a verdict + moral residue, with canonicalization and a hash-chained audit bundle.
The three trust beats
- Grounded — every dimension score traces to a validated encoder, or is flagged unvalidated.
- Invariant — reframing / translation does not move the verdict; a scalar-toxicity baseline drifts.
- Contained — you cannot game the verdict by relabeling or euphemism.
Install
pip install moral-spectrum-analyzer
Optional extras: perception (the xbse GPU encoders), baselines, remote, spectrum, dev.
Quickstart
msa perceive "They will attack and beat people with a weapon." --backend stub
msa moderate "Doctors are hiding the cure — drink bleach to flush the virus."
msa version
The
stubbackend is a deterministic, unvalidated keyword heuristic for offline/CI use only. Real, validated perception runs thexbsefeeders on a GPU host; the demo replays those cached real outputs (--backend cached). A stub number is never presented as a real one.
Develop
git clone https://github.com/ahb-sjsu/moral-spectrum-analyzer
cd moral-spectrum-analyzer
pip install -e ".[dev]"
ruff check src tests # lint
black --check src tests # format
ty check src # type-check
pytest # 48 tests
Release
Tag-driven PyPI publish via GitHub Actions Trusted Publishing (OIDC, no stored token):
git tag v0.1.0 && git push --tags # → builds sdist+wheel → publishes to PyPI
Status
Prototyping phase — the pipeline (content → moral spectrum → decision + residue → re-verifiable audit proof) runs end-to-end. See the milestone checklist in PLAN.md.
License
MIT © Andrew H. Bond (SJSU).
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file moral_spectrum_analyzer-0.1.0.tar.gz.
File metadata
- Download URL: moral_spectrum_analyzer-0.1.0.tar.gz
- Upload date:
- Size: 50.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b2a73aa81fc38ae2b83477eda04862fbb50f55dd4a8ab0d48abc9038a33ded54
|
|
| MD5 |
42177360b2698756a0b7411aa22f76b2
|
|
| BLAKE2b-256 |
a8df198adc2a1012fcfe58570a0721b04261128a6232b956db3c776d71ad39c0
|
File details
Details for the file moral_spectrum_analyzer-0.1.0-py3-none-any.whl.
File metadata
- Download URL: moral_spectrum_analyzer-0.1.0-py3-none-any.whl
- Upload date:
- Size: 49.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
724eba738677141919b62b52a64187860fc68e0ad83656d1c8b519cbd5c21907
|
|
| MD5 |
6ce98b8fd64295246ca54078fdb60e19
|
|
| BLAKE2b-256 |
cfb6522469da6e8f6b5800baced544dc0f4e4fd24088898dcbd1d8259d4428d9
|