Skip to main content

Patristic Ethics Agent (PEA)

PEA is an experimental dialogue/action review layer grounded in an owner-approved Christian patristic constitution; the corpus remains under review. It interprets expressed requests and context, applies deterministic policy, retrieves exact source quotations, and supplies guidance. It does not claim to read hidden intentions.

Engineering backlog E1–E6 is implemented. This is not a qualified release: corpus editorial review, live host acceptance, operator OS isolation, untouched human-reviewed holdouts and backend accuracy/latency remain pending. The policy is approved; the corpus remains partly draft. Current acceptance: M2 complete; M0/M1/M3/M4/M5/M6 partial. See the canonical plan and remaining external dependencies.

Packages

The 0.0.1 packaging is implemented and reviewed; nothing has been published yet.

Registry Package
PyPI patristic-ethics
npm pea-mcp

No npm package has been published yet. The Codex and Claude Code hooks are Python console scripts in the PyPI package; the OpenCode plugin runs from this checkout. After publication, generic MCP hosts run npx pea-mcp. The launcher prefers uvx --from patristic-ethics pea-mcp and falls back to python -m patristic_ethics.mcp_server; it never installs packages silently. Names, review evidence, and publish commands: docs/releases/publishing.md.

Run from this checkout

Python 3.11+ is required. Install the locked dependencies when package-index access is available:

uv sync --frozen --extra dev

The existing .venv supports these source-checkout commands:

.venv/bin/python -m patristic_ethics.cli corpus validate corpus/seed.jsonl
.venv/bin/python -m patristic_ethics.cli corpus build corpus/seed.jsonl --db corpus/units.db
.venv/bin/python -m patristic_ethics.cli assess --backend fake --input tests/fixtures/assess/benign.json
.venv/bin/pytest -q

fake exercises plumbing and limited lexical fallback; it is not a usable semantic-quality claim. For configured local inference, use assess --backend ollama with --model, --host, --timeout, optional positive --context-length, and --thinking model-default|on|off. The project default is now deepseek-v4.1-flash:cloud through Ollama. The installed ornith-1.5:9b remains a local fallback; its CPU-only diagnostic had substantial delays/timeouts. The first 20-case deepseek-v4.1-flash:cloud latency smoke reached p95 6.512 s with 19/20 successes and one timeout; the evidence.

Remote interpreter backends

Remote inference uses --backend remote with a provider preset. API keys are read from environment variables; never pass them on the command line.

# OPENAI_API_KEY is set in the environment
.venv/bin/python -m patristic_ethics.cli assess --backend remote \
  --provider openai --model <model> --timeout 8 --input tests/fixtures/assess/benign.json

# DEEPSEEK_API_KEY is set in the environment
.venv/bin/python -m patristic_ethics.cli assess --backend remote \
  --provider deepseek --model deepseek-chat --timeout 8 --input tests/fixtures/assess/benign.json

# ANTHROPIC_API_KEY is set in the environment
.venv/bin/python -m patristic_ethics.cli assess --backend remote \
  --provider anthropic --model <model> --timeout 8 --input tests/fixtures/assess/benign.json

# Custom OpenAI-compatible endpoint
.venv/bin/python -m patristic_ethics.cli assess --backend remote \
  --provider custom --remote-url https://host/v1 --model <model> --timeout 8

Provider presets: openai, deepseek, anthropic, openrouter, groq, together, and custom. Use --no-json-mode for endpoints that reject response_format=json_object. The controlled clients accept the same --backend remote plus --interpreter-provider, --interpreter-base-url, --interpreter-api-key-env, and --interpreter-timeout.

Operator isolation

sudo bash scripts/setup_operator_isolation.sh

The script creates a separate pea-operator identity, an operator-owned runtime.db with mode 0600, and a root-owned token with mode 0640. It prints direct-read and direct-write denial checks. It was syntax-checked here but not run: sudo requires interactive authentication. The current agent user is in the sudo group, so the script warns; remove that membership or run the agent under a non-admin identity before claiming the boundary.

Host modes

Host Native adapter Controlled display
OpenCode Advisory prompt guidance and covered pre-tool gate; text-only SDK history Tools-disabled runner checks effective config, buffers candidates and assesses before release; live managed-policy/compaction evidence incomplete
Codex Covered prompt/pre-tool block protocol, optional hook-observed history; live delivery incomplete Unsupported: preventive tools-disabled boundary not established
Claude Code Covered prompt/pre-tool block protocol, optional hook-observed history; live delivery incomplete Tools-disabled print/JSON runner with buffered review; live enforcement/continuation evidence incomplete

Native hooks provide no general before-display guarantee. Their covered error responses require the hook process to remain alive. The shared conformance report covers synthetic adapter contracts, not installed-host enforcement. Host versions, examples and limits: OpenCode, Codex, Claude.

Host setup

PEA does not configure a host automatically. Choose one surface:

Surface What it checks Setup
MCP server Exposes four read-only tools; the host must call check_action Add npx pea-mcp to the host
MCP proxy Every downstream tools/call before it runs Launch the proxy as the host's MCP command
Codex hooks Supported prompt and pre-tool events Add examples/codex/hooks.json
Claude Code hooks Supported prompt and pre-tool events Add examples/claude-code/settings.json
OpenCode plugin Advisory input and covered pre-tool events Load adapters/opencode/index.ts
Controlled client Input and output; buffers host output Run pea-controlled or pea-controlled-claude

MCP server. Add the server in the host configuration:

{
  "mcpServers": {
    "pea": {
      "command": "npx",
      "args": ["pea-mcp"]
    }
  }
}

The server only exposes tools. The host or model must call check_action; the server cannot intercept other tools. For automatic tool gating, run the proxy as the host's MCP command:

python -m patristic_ethics.proxy \
  --downstream-cmd "npx -y @modelcontextprotocol/server-filesystem /tmp" \
  --backend ollama

Codex. Copy the example hook file and replace its command with the installed console script:

mkdir -p .codex
cp examples/codex/hooks.json .codex/hooks.json
# .codex/hooks.json: "command": "pea-codex-hook"

Enable hooks in ~/.codex/config.toml:

[features]
hooks = true

Open the project in Codex and trust the project hook. An untrusted hook file is silently skipped. From this checkout, use uv run --project "$PWD" python -m patristic_ethics.adapters.codex as the command instead of pea-codex-hook.

Claude Code. Copy the example settings and replace the command with pea-claude-hook:

mkdir -p .claude
cp examples/claude-code/settings.json .claude/settings.json
# .claude/settings.json: "command": "pea-claude-hook"

To test without changing your user settings:

claude --settings "$PWD/examples/claude-code/settings.json" --print "How do I write a regex?"

The example covers UserPromptSubmit and PreToolUse for Bash only. From this checkout, use uv run --project "$PWD" python -m patristic_ethics.adapters.claude_code.

OpenCode. Copy the plugin and example config:

cp examples/opencode/opencode.json ./opencode.json
mkdir -p .opencode/plugins
cp adapters/opencode/index.ts .opencode/plugins/pea-ethics.ts
# opencode.json: "plugin": [".opencode/plugins/pea-ethics.ts"]

Set the CLI and data paths in the host environment:

export PEA_CLI="uv run --project $PWD python -m patristic_ethics.cli"
export PEA_DB="$PWD/corpus/units.db"
export PEA_POLICY="$PWD/policy/rules.json"
export PEA_BACKEND="ollama"

Controlled clients. The controlled client is the only before-display path. For OpenCode, put the tools-disabled profile in the target directory, then run:

cp examples/opencode/controlled/opencode.json ./opencode.json
pea-controlled --prompt "How do I kill a process on Linux?" \
  --dir . --model ollama/deepseek-v4.1-flash:cloud --backend ollama

For Claude Code:

pea-controlled-claude --interactive --dir . --backend ollama

From this checkout, use uv run --project "$PWD" python -m patristic_ethics.controlled or ...claude_controlled. The client buffers all host stdout and releases only assessed text. --revise-once is opt-in.

Publishing either package does not activate any of these surfaces. The user or host administrator must add one.

Controlled CLI examples use explicit backends/models:

.venv/bin/python -m patristic_ethics.controlled --backend ollama \
  --model ollama/ornith-1.5:9b --prompt 'Explain a Python addition function.'
.venv/bin/python -m patristic_ethics.claude_controlled --backend ollama \
  --prompt 'Explain a Python addition function.'

The Claude command invokes your configured Claude host and may require credentials/use paid inference. These commands are examples, not recorded successful live runs. Both clients accept --interactive, --interpreter-context-length, --interpreter-thinking, and opt-in --revise-once. Revision defaults off; when enabled, at most one fresh host correction is semantically/structurally rechecked with safe fallback. Rejected text is excluded from future visible history. Dialogue history is limited to 40 released messages / 16000 characters with explicit loss notices.

Native Python history is opt-in through the operator-configured PEA_HISTORY_DB path; transcript paths supplied by hook payloads are not read. This observed history remains incomplete. Keep native plugins and controlled profiles separate. Shell-capable review workflows require deployment isolation first; the operator boundary remains unproven at OS level.

Evaluation and operator workflow

.venv/bin/python eval/compare.py --cases eval/scenarios.jsonl --backend fake --output /tmp/pea-comparison.json
.venv/bin/python eval/grade.py --report /tmp/pea-comparison.json \
  --grades /path/to/actual-reviewer-grades.jsonl --output /tmp/pea-reviewed-comparison.json
.venv/bin/python -m patristic_ethics.operator --db corpus/runtime.db attempts

Comparison outputs are development data. Grade ingestion binds actual reviewer judgments to report/response hashes, keeps missing grades ungraded and preserves disagreements. No actual reviewer grades or release holdout exist. attempts inspects uncertain dispatches without resetting or retrying them; establish the external outcome before any new reviewed action.

Optional process checks require an environment that permits their transports:

PEA_RUN_BUN_TEST=1 .venv/bin/pytest -q tests/integration/test_shared_host_conformance.py tests/test_history_limits.py
PEA_RUN_STDIO_TEST=1 .venv/bin/pytest -q tests/integration/test_proxy.py

Citation lanes (CSL-JSON)

Modern government and scripture sources use CSL-JSON in corpus/modern.jsonl and corpus/scripture.jsonl. Each lane has its own SQLite/FTS5 database and a source_class label (modern_government or scripture). Neither lane is patristic evidence.

.venv/bin/python -m patristic_ethics.cli corpus validate-csl corpus/modern.jsonl --lane modern
.venv/bin/python -m patristic_ethics.cli corpus build-csl corpus/modern.jsonl --lane modern
.venv/bin/python -m patristic_ethics.cli corpus search-csl terrorism --db corpus/modern.db

.venv/bin/python -m patristic_ethics.cli corpus validate-csl corpus/scripture.jsonl --lane scripture
.venv/bin/python -m patristic_ethics.cli corpus build-csl corpus/scripture.jsonl --lane scripture
.venv/bin/python -m patristic_ethics.cli corpus search-csl peacemakers --db corpus/scripture.db

CiteIndex is the external ingestion tool at /home/ajiap/project/citeindex (v0.15.0). The runtime consumes CSL-JSON records; it does not import CiteIndex. PEA-specific fields live under custom: citation_index, principle_ids, locus, text, text_sha256, rights_status, rights_evidence, review_status, and verification_method. The nine current records are owner-reviewed; the three modern records remain public-domain-unverified for third-party material.

Linked provenance records live in corpus/provenance.jsonl. They use CSL-JSON and link catalogues, editions, and secondary literature to seed unit IDs:

.venv/bin/python -m patristic_ethics.cli corpus validate-provenance corpus/provenance.jsonl --seed corpus/seed.jsonl
.venv/bin/python -m patristic_ethics.cli corpus validate-primary-citations corpus/primary_citations.jsonl --seed corpus/seed.jsonl
.venv/bin/python -m patristic_ethics.cli corpus validate-secondary corpus/secondary.jsonl --seed corpus/seed.jsonl

primary_citations.jsonl keeps a CSL citation beside every reviewed primary unit and preserves the CTS URN in custom.cts_urn. secondary.jsonl is an author-level reference pilot: eight records link two sources to each reviewed unit. Passage-specific secondary interpretation and runtime rendering are out of scope.

Further reading is a bibliography only; it is never quoted in guidance. The canonical import path is corpus/further_reading.jsonl, delivered as JSONL with CSL fields and PEA fields under custom. The file now holds 145 draft-unreviewed records imported on 2026-10-23; corpus/further_reading.example.jsonl remains the validator example.

Import quality at a glance: 75 records carry a DOI, 70 are URL-only, 28 are Google Scholar leads, none has an ISBN, and 58 have unknown rights status. Re-verification found 76 records with matching Crossref or URL metadata, 40 lead-only records, 16 blocked sources, 4 unchecked PDFs, and 9 remaining metadata issues. The two DOI errors were corrected with Crossref title evidence; the nine partial records keep local metadata with visible flags. The owner decided to keep all 145 records and show verification flags; no record was deleted. The 40 lead-only records are approved as a discovery list and remain flagged. The 76 verified records are owner-accepted without a spot check and marked reviewed; 69 records remain draft-unreviewed. Owner review is the next gate; see the verification report.

.venv/bin/python -m patristic_ethics.cli corpus validate-further-reading corpus/further_reading.jsonl --seed corpus/seed.jsonl
.venv/bin/python -m patristic_ethics.cli further-reading --principle PEA-P01
.venv/bin/python -m patristic_ethics.cli further-reading --format markdown

See the generated bibliography and the format guide.

Frozen experimental configuration

Profile and snapshot record baseline/tuning settings, declared host modes, package/model identity limits, source/corpus/policy/lock hashes and selected evidence. The profile is a declaration, not an automatically applied deployment preset. Verification checks local file integrity; it does not validate installed packages, model weights, credentials or host behavior.

.venv/bin/python eval/freeze.py --verify docs/releases/pea-0.0.1-experimental-snapshot.json

After changes, preserve the old snapshot and generate a new versioned one:

.venv/bin/python eval/freeze.py --profile docs/releases/pea-0.0.1-experimental-profile.json \
  --output /tmp/pea-new-experimental-snapshot.json

The tool refuses release-ready declarations, project-escaping/hidden/symlinked inputs and existing output files. It excludes private runtime/history databases, environment credentials, caches and dependency directories. A snapshot is experimental evidence, not proof that M0–M6 acceptance is complete.

Metadata

Release files for patristic-ethics 0.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for patristic-ethics 0.0.1
File Size Uploaded Provenance Actions
patristic_ethics-0.0.1.tar.gz 107.6 kB Without provenance Details for patristic_ethics-0.0.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for patristic-ethics 0.0.1
File Interpreter ABI Platform Actions
patristic_ethics-0.0.1-py3-none-any.whl Python 3 none any Details for patristic_ethics-0.0.1-py3-none-any.whl

Total release size: 231.3 kB

Release files / patristic_ethics-0.0.1.tar.gz

Download URL patristic_ethics-0.0.1.tar.gz
Size 107.6 kB
Tags Source
SHA-256 checksum
How to use checksums
aaf88be5526b6f6152dc9f904def33f283a7bc09b5e938b509ddd68f688d297d
BLAKE2b-256 checksum
How to use checksums
f2f745bfeb1386dd634a3cc560bf701647430cad8b1c43b9b8d2ce3deb6a3bd6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.6 {"installer":{"name":"uv","version":"0.13.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Omarchy","version":"4.0.6","id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / patristic_ethics-0.0.1-py3-none-any.whl

Download URL patristic_ethics-0.0.1-py3-none-any.whl
Size 123.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
98d3a668674371dfc75fe6d32d602d10270ce537f033fe698e8cd3dc000f3192
BLAKE2b-256 checksum
How to use checksums
667c244e8aa3f402d751a32f5cc55418eb2526458c114c6974e75f0c12c9f759
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.6 {"installer":{"name":"uv","version":"0.13.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Omarchy","version":"4.0.6","id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for patristic-ethics 0.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.0.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page