ehor 0.1.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- ehor-0.1.1/.github/workflows/ci.yml +81 -0
- ehor-0.1.1/.github/workflows/commits.yml +32 -0
- ehor-0.1.1/.github/workflows/release.yml +61 -0
- ehor-0.1.1/.gitignore +18 -0
- ehor-0.1.1/.pre-commit-config.yaml +37 -0
- ehor-0.1.1/.python-version +1 -0
- ehor-0.1.1/CLAUDE.md +81 -0
- ehor-0.1.1/CONTRIBUTING.md +88 -0
- ehor-0.1.1/LICENSE +21 -0
- ehor-0.1.1/PKG-INFO +288 -0
- ehor-0.1.1/README.md +261 -0
- ehor-0.1.1/claude/CLAUDE.md +10 -0
- ehor-0.1.1/claude/commands/handoff.md +13 -0
- ehor-0.1.1/claude/commands/inbox.md +4 -0
- ehor-0.1.1/docs/assets/how-it-works.svg +34 -0
- ehor-0.1.1/docs/assets/logo-dark.svg +4 -0
- ehor-0.1.1/docs/assets/logo-light.svg +4 -0
- ehor-0.1.1/docs/assets/mark.svg +4 -0
- ehor-0.1.1/docs/assets/screenshot-claude.svg +23 -0
- ehor-0.1.1/docs/assets/screenshot-setup.svg +25 -0
- ehor-0.1.1/docs/assets/screenshot-team.svg +20 -0
- ehor-0.1.1/docs/protocol.md +360 -0
- ehor-0.1.1/pyproject.toml +90 -0
- ehor-0.1.1/scripts/check_commit_msg.py +74 -0
- ehor-0.1.1/src/ehor/__init__.py +3 -0
- ehor-0.1.1/src/ehor/cli.py +457 -0
- ehor-0.1.1/src/ehor/crypto/__init__.py +0 -0
- ehor-0.1.1/src/ehor/crypto/keyfile.py +56 -0
- ehor-0.1.1/src/ehor/crypto/sealing.py +104 -0
- ehor-0.1.1/src/ehor/identity/__init__.py +21 -0
- ehor-0.1.1/src/ehor/identity/assertion.py +56 -0
- ehor-0.1.1/src/ehor/identity/backends.py +54 -0
- ehor-0.1.1/src/ehor/identity/base.py +67 -0
- ehor-0.1.1/src/ehor/identity/ctap.py +142 -0
- ehor-0.1.1/src/ehor/identity/enclave_helper.swift +38 -0
- ehor-0.1.1/src/ehor/identity/es256.py +38 -0
- ehor-0.1.1/src/ehor/identity/secure_enclave.py +126 -0
- ehor-0.1.1/src/ehor/identity/security_key.py +127 -0
- ehor-0.1.1/src/ehor/identity/software.py +82 -0
- ehor-0.1.1/src/ehor/identity/tools.py +56 -0
- ehor-0.1.1/src/ehor/identity/tpm.py +155 -0
- ehor-0.1.1/src/ehor/log/__init__.py +0 -0
- ehor-0.1.1/src/ehor/log/authorize.py +39 -0
- ehor-0.1.1/src/ehor/log/body.py +173 -0
- ehor-0.1.1/src/ehor/log/canonical.py +57 -0
- ehor-0.1.1/src/ehor/log/endpoint_announce.py +34 -0
- ehor-0.1.1/src/ehor/log/entry.py +212 -0
- ehor-0.1.1/src/ehor/log/envelope.py +118 -0
- ehor-0.1.1/src/ehor/log/key_announce.py +34 -0
- ehor-0.1.1/src/ehor/log/names.py +34 -0
- ehor-0.1.1/src/ehor/log/roster.py +281 -0
- ehor-0.1.1/src/ehor/log/verify.py +137 -0
- ehor-0.1.1/src/ehor/mcp/__init__.py +0 -0
- ehor-0.1.1/src/ehor/mcp/server.py +90 -0
- ehor-0.1.1/src/ehor/py.typed +0 -0
- ehor-0.1.1/src/ehor/relay/__init__.py +0 -0
- ehor-0.1.1/src/ehor/relay/server.py +130 -0
- ehor-0.1.1/src/ehor/roster/__init__.py +0 -0
- ehor-0.1.1/src/ehor/roster/book.py +171 -0
- ehor-0.1.1/src/ehor/service/__init__.py +0 -0
- ehor-0.1.1/src/ehor/service/api.py +136 -0
- ehor-0.1.1/src/ehor/service/config.py +82 -0
- ehor-0.1.1/src/ehor/service/daemon.py +56 -0
- ehor-0.1.1/src/ehor/service/device.py +309 -0
- ehor-0.1.1/src/ehor/service/direct_sync.py +175 -0
- ehor-0.1.1/src/ehor/service/directory.py +42 -0
- ehor-0.1.1/src/ehor/service/endpoints.py +22 -0
- ehor-0.1.1/src/ehor/service/invite.py +79 -0
- ehor-0.1.1/src/ehor/service/iroh_key.py +71 -0
- ehor-0.1.1/src/ehor/service/messenger.py +488 -0
- ehor-0.1.1/src/ehor/service/peer_sync.py +83 -0
- ehor-0.1.1/src/ehor/service/relay_policy.py +73 -0
- ehor-0.1.1/src/ehor/service/render.py +141 -0
- ehor-0.1.1/src/ehor/service/roster_admin.py +284 -0
- ehor-0.1.1/src/ehor/service/rpc.py +159 -0
- ehor-0.1.1/src/ehor/service/sealing.py +105 -0
- ehor-0.1.1/src/ehor/store/__init__.py +0 -0
- ehor-0.1.1/src/ehor/store/base.py +82 -0
- ehor-0.1.1/src/ehor/store/ingest.py +112 -0
- ehor-0.1.1/src/ehor/store/local_log.py +85 -0
- ehor-0.1.1/src/ehor/store/sqlite.py +276 -0
- ehor-0.1.1/src/ehor/sync/__init__.py +0 -0
- ehor-0.1.1/src/ehor/sync/session.py +209 -0
- ehor-0.1.1/src/ehor/sync/wire.py +166 -0
- ehor-0.1.1/src/ehor/transport/__init__.py +0 -0
- ehor-0.1.1/src/ehor/transport/directory.py +76 -0
- ehor-0.1.1/src/ehor/transport/iroh.py +311 -0
- ehor-0.1.1/src/ehor/transport/lan.py +170 -0
- ehor-0.1.1/src/ehor/transport/relays.py +28 -0
- ehor-0.1.1/tests/conftest.py +87 -0
- ehor-0.1.1/tests/crypto/test_keyfile.py +62 -0
- ehor-0.1.1/tests/crypto/test_sealing.py +89 -0
- ehor-0.1.1/tests/identity/test_assertion.py +98 -0
- ehor-0.1.1/tests/identity/test_backends.py +52 -0
- ehor-0.1.1/tests/identity/test_ctap.py +286 -0
- ehor-0.1.1/tests/identity/test_es256.py +64 -0
- ehor-0.1.1/tests/identity/test_secure_enclave.py +171 -0
- ehor-0.1.1/tests/identity/test_security_key.py +133 -0
- ehor-0.1.1/tests/identity/test_software.py +85 -0
- ehor-0.1.1/tests/identity/test_tools.py +49 -0
- ehor-0.1.1/tests/identity/test_tpm.py +231 -0
- ehor-0.1.1/tests/integration/test_direct_delivery.py +185 -0
- ehor-0.1.1/tests/integration/test_relay_delivery.py +61 -0
- ehor-0.1.1/tests/integration/test_relay_gate.py +60 -0
- ehor-0.1.1/tests/integration/test_signed_log.py +65 -0
- ehor-0.1.1/tests/integration/test_team.py +143 -0
- ehor-0.1.1/tests/log/test_body.py +90 -0
- ehor-0.1.1/tests/log/test_canonical.py +68 -0
- ehor-0.1.1/tests/log/test_endpoint_announce.py +27 -0
- ehor-0.1.1/tests/log/test_entry.py +116 -0
- ehor-0.1.1/tests/log/test_envelope.py +105 -0
- ehor-0.1.1/tests/log/test_key_announce.py +24 -0
- ehor-0.1.1/tests/log/test_names.py +41 -0
- ehor-0.1.1/tests/log/test_roster.py +177 -0
- ehor-0.1.1/tests/log/test_verify.py +355 -0
- ehor-0.1.1/tests/mcp/test_server.py +86 -0
- ehor-0.1.1/tests/relay/test_relay.py +70 -0
- ehor-0.1.1/tests/roster/test_book.py +391 -0
- ehor-0.1.1/tests/roster/test_roster_before_membership.py +52 -0
- ehor-0.1.1/tests/security_key_emulator.py +68 -0
- ehor-0.1.1/tests/service/test_api.py +61 -0
- ehor-0.1.1/tests/service/test_device.py +322 -0
- ehor-0.1.1/tests/service/test_device_endpoint.py +156 -0
- ehor-0.1.1/tests/service/test_direct_sync.py +305 -0
- ehor-0.1.1/tests/service/test_encryption.py +137 -0
- ehor-0.1.1/tests/service/test_endpoints.py +44 -0
- ehor-0.1.1/tests/service/test_invite.py +89 -0
- ehor-0.1.1/tests/service/test_messenger.py +377 -0
- ehor-0.1.1/tests/service/test_peer_sync.py +135 -0
- ehor-0.1.1/tests/service/test_relay_policy.py +93 -0
- ehor-0.1.1/tests/service/test_roster_admin.py +282 -0
- ehor-0.1.1/tests/service/test_roster_directory.py +93 -0
- ehor-0.1.1/tests/service/test_rpc.py +125 -0
- ehor-0.1.1/tests/service/test_sealing_codec.py +57 -0
- ehor-0.1.1/tests/store/test_ingest.py +156 -0
- ehor-0.1.1/tests/store/test_ingest_authorization.py +129 -0
- ehor-0.1.1/tests/store/test_local_log.py +148 -0
- ehor-0.1.1/tests/store/test_sqlite.py +228 -0
- ehor-0.1.1/tests/sync/test_session.py +198 -0
- ehor-0.1.1/tests/sync/test_streams.py +171 -0
- ehor-0.1.1/tests/sync/test_wire.py +90 -0
- ehor-0.1.1/tests/test_check_commit_msg.py +49 -0
- ehor-0.1.1/tests/test_cli.py +354 -0
- ehor-0.1.1/tests/test_package.py +7 -0
- ehor-0.1.1/tests/transport/test_directory.py +129 -0
- ehor-0.1.1/tests/transport/test_iroh.py +222 -0
- ehor-0.1.1/tests/transport/test_lan.py +92 -0
- ehor-0.1.1/tests/transport/test_relays.py +22 -0
- ehor-0.1.1/uv.lock +1625 -0
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: ["**"]
|
|
6
|
+
pull_request:
|
|
7
|
+
|
|
8
|
+
concurrency:
|
|
9
|
+
group: ${{ github.workflow }}-${{ github.ref }}
|
|
10
|
+
cancel-in-progress: true
|
|
11
|
+
|
|
12
|
+
permissions:
|
|
13
|
+
contents: read
|
|
14
|
+
|
|
15
|
+
jobs:
|
|
16
|
+
lint:
|
|
17
|
+
name: Lint and type-check
|
|
18
|
+
runs-on: ubuntu-latest
|
|
19
|
+
steps:
|
|
20
|
+
- uses: actions/checkout@v5
|
|
21
|
+
- uses: astral-sh/setup-uv@v6
|
|
22
|
+
with:
|
|
23
|
+
enable-cache: true
|
|
24
|
+
- run: uv sync --locked
|
|
25
|
+
- run: uv run ruff check .
|
|
26
|
+
- run: uv run ruff format --check .
|
|
27
|
+
- run: uv run mypy
|
|
28
|
+
|
|
29
|
+
test:
|
|
30
|
+
name: Test (${{ matrix.os }}, py${{ matrix.python }})
|
|
31
|
+
runs-on: ${{ matrix.os }}
|
|
32
|
+
strategy:
|
|
33
|
+
fail-fast: false
|
|
34
|
+
matrix:
|
|
35
|
+
os: [ubuntu-latest, macos-latest, windows-latest]
|
|
36
|
+
python: ["3.11", "3.13"]
|
|
37
|
+
steps:
|
|
38
|
+
- uses: actions/checkout@v5
|
|
39
|
+
- uses: astral-sh/setup-uv@v6
|
|
40
|
+
with:
|
|
41
|
+
enable-cache: true
|
|
42
|
+
python-version: ${{ matrix.python }}
|
|
43
|
+
- run: uv sync --locked
|
|
44
|
+
- run: uv run pytest --cov --cov-report=term-missing
|
|
45
|
+
|
|
46
|
+
tpm:
|
|
47
|
+
name: Test TPM keys (swtpm)
|
|
48
|
+
runs-on: ubuntu-latest
|
|
49
|
+
env:
|
|
50
|
+
EHOR_TPM_TEST: "1"
|
|
51
|
+
TPM2TOOLS_TCTI: device:/dev/tpmrm0
|
|
52
|
+
steps:
|
|
53
|
+
- uses: actions/checkout@v5
|
|
54
|
+
- uses: astral-sh/setup-uv@v6
|
|
55
|
+
with:
|
|
56
|
+
enable-cache: true
|
|
57
|
+
- run: sudo apt-get update && sudo apt-get install -y swtpm swtpm-tools tpm2-tools
|
|
58
|
+
- name: Start a software TPM behind the kernel resource manager
|
|
59
|
+
run: |
|
|
60
|
+
sudo modprobe tpm_vtpm_proxy
|
|
61
|
+
mkdir -p "$RUNNER_TEMP/tpm"
|
|
62
|
+
sudo swtpm chardev --vtpm-proxy --tpm2 --daemon \
|
|
63
|
+
--tpmstate dir="$RUNNER_TEMP/tpm" --flags startup-clear
|
|
64
|
+
for _ in 1 2 3 4 5; do [ -e /dev/tpmrm0 ] && break; sleep 1; done
|
|
65
|
+
sudo chmod a+rw /dev/tpmrm0
|
|
66
|
+
tpm2_getcap properties-fixed > /dev/null
|
|
67
|
+
- run: uv sync --locked
|
|
68
|
+
- run: uv run pytest tests/identity/test_tpm.py -rs
|
|
69
|
+
|
|
70
|
+
build:
|
|
71
|
+
name: Build distributions
|
|
72
|
+
runs-on: ubuntu-latest
|
|
73
|
+
needs: [lint, test, tpm]
|
|
74
|
+
steps:
|
|
75
|
+
- uses: actions/checkout@v5
|
|
76
|
+
- uses: astral-sh/setup-uv@v6
|
|
77
|
+
- run: uv build
|
|
78
|
+
- uses: actions/upload-artifact@v4
|
|
79
|
+
with:
|
|
80
|
+
name: dist
|
|
81
|
+
path: dist/
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
name: Commit messages
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: ["**"]
|
|
6
|
+
pull_request:
|
|
7
|
+
|
|
8
|
+
permissions:
|
|
9
|
+
contents: read
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
conventional-commits:
|
|
13
|
+
runs-on: ubuntu-latest
|
|
14
|
+
steps:
|
|
15
|
+
- uses: actions/checkout@v5
|
|
16
|
+
with:
|
|
17
|
+
fetch-depth: 0
|
|
18
|
+
- uses: actions/setup-python@v5
|
|
19
|
+
with:
|
|
20
|
+
python-version: "3.12"
|
|
21
|
+
- name: Check pull request commits
|
|
22
|
+
if: github.event_name == 'pull_request'
|
|
23
|
+
run: python scripts/check_commit_msg.py --range "${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }}"
|
|
24
|
+
- name: Check commits pushed to a branch
|
|
25
|
+
if: github.event_name == 'push' && github.ref != 'refs/heads/main'
|
|
26
|
+
run: python scripts/check_commit_msg.py --range "origin/main..${{ github.sha }}"
|
|
27
|
+
- name: Check commits pushed to main
|
|
28
|
+
if: github.event_name == 'push' && github.ref == 'refs/heads/main' && github.event.before != '0000000000000000000000000000000000000000'
|
|
29
|
+
run: python scripts/check_commit_msg.py --range "${{ github.event.before }}..${{ github.sha }}"
|
|
30
|
+
- name: Check full history on first push to main
|
|
31
|
+
if: github.event_name == 'push' && github.ref == 'refs/heads/main' && github.event.before == '0000000000000000000000000000000000000000'
|
|
32
|
+
run: python scripts/check_commit_msg.py --range "${{ github.sha }}"
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
name: Release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags: ["v*.*.*"]
|
|
6
|
+
|
|
7
|
+
permissions:
|
|
8
|
+
contents: read
|
|
9
|
+
|
|
10
|
+
jobs:
|
|
11
|
+
build:
|
|
12
|
+
runs-on: ubuntu-latest
|
|
13
|
+
steps:
|
|
14
|
+
- uses: actions/checkout@v5
|
|
15
|
+
- uses: astral-sh/setup-uv@v6
|
|
16
|
+
- name: Check tag matches project version
|
|
17
|
+
run: |
|
|
18
|
+
version="$(uv version --short)"
|
|
19
|
+
if [ "v${version}" != "${GITHUB_REF_NAME}" ]; then
|
|
20
|
+
echo "Tag ${GITHUB_REF_NAME} does not match pyproject version ${version}" >&2
|
|
21
|
+
exit 1
|
|
22
|
+
fi
|
|
23
|
+
- run: uv sync --locked
|
|
24
|
+
- run: uv run pytest
|
|
25
|
+
- run: uv build
|
|
26
|
+
- uses: actions/upload-artifact@v4
|
|
27
|
+
with:
|
|
28
|
+
name: dist
|
|
29
|
+
path: dist/
|
|
30
|
+
|
|
31
|
+
pypi:
|
|
32
|
+
needs: build
|
|
33
|
+
runs-on: ubuntu-latest
|
|
34
|
+
environment:
|
|
35
|
+
name: pypi
|
|
36
|
+
url: https://pypi.org/p/ehor
|
|
37
|
+
permissions:
|
|
38
|
+
id-token: write
|
|
39
|
+
steps:
|
|
40
|
+
- uses: actions/download-artifact@v4
|
|
41
|
+
with:
|
|
42
|
+
name: dist
|
|
43
|
+
path: dist/
|
|
44
|
+
- uses: pypa/gh-action-pypi-publish@release/v1
|
|
45
|
+
|
|
46
|
+
github-release:
|
|
47
|
+
needs: pypi
|
|
48
|
+
runs-on: ubuntu-latest
|
|
49
|
+
permissions:
|
|
50
|
+
contents: write
|
|
51
|
+
steps:
|
|
52
|
+
- uses: actions/download-artifact@v4
|
|
53
|
+
with:
|
|
54
|
+
name: dist
|
|
55
|
+
path: dist/
|
|
56
|
+
- name: Publish GitHub release
|
|
57
|
+
env:
|
|
58
|
+
GH_TOKEN: ${{ github.token }}
|
|
59
|
+
run: >-
|
|
60
|
+
gh release create "${GITHUB_REF_NAME}" dist/*
|
|
61
|
+
--repo "${GITHUB_REPOSITORY}" --generate-notes --verify-tag
|
ehor-0.1.1/.gitignore
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
default_install_hook_types: [pre-commit, commit-msg]
|
|
2
|
+
default_stages: [pre-commit]
|
|
3
|
+
|
|
4
|
+
repos:
|
|
5
|
+
- repo: https://github.com/pre-commit/pre-commit-hooks
|
|
6
|
+
rev: v5.0.0
|
|
7
|
+
hooks:
|
|
8
|
+
- id: trailing-whitespace
|
|
9
|
+
- id: end-of-file-fixer
|
|
10
|
+
- id: check-yaml
|
|
11
|
+
- id: check-toml
|
|
12
|
+
- id: check-added-large-files
|
|
13
|
+
- id: detect-private-key
|
|
14
|
+
|
|
15
|
+
- repo: local
|
|
16
|
+
hooks:
|
|
17
|
+
- id: ruff-check
|
|
18
|
+
name: ruff check
|
|
19
|
+
entry: uv run ruff check --fix
|
|
20
|
+
language: system
|
|
21
|
+
types: [python]
|
|
22
|
+
- id: ruff-format
|
|
23
|
+
name: ruff format
|
|
24
|
+
entry: uv run ruff format
|
|
25
|
+
language: system
|
|
26
|
+
types: [python]
|
|
27
|
+
- id: mypy
|
|
28
|
+
name: mypy
|
|
29
|
+
entry: uv run mypy
|
|
30
|
+
language: system
|
|
31
|
+
types: [python]
|
|
32
|
+
pass_filenames: false
|
|
33
|
+
- id: conventional-commit
|
|
34
|
+
name: conventional commit message
|
|
35
|
+
entry: uv run python scripts/check_commit_msg.py --file
|
|
36
|
+
language: system
|
|
37
|
+
stages: [commit-msg]
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
3.12
|
ehor-0.1.1/CLAUDE.md
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
# ehor — Project Rules
|
|
2
|
+
|
|
3
|
+
These rules apply to every contributor, human or agent. They are not optional.
|
|
4
|
+
|
|
5
|
+
## Git history
|
|
6
|
+
|
|
7
|
+
- **Atomic commits.** One logical change per commit. A commit must build, pass lint, type-check and tests on its own.
|
|
8
|
+
- Never bundle unrelated changes. Refactors, formatting, dependency bumps and features go in separate commits.
|
|
9
|
+
- **Conventional Commits** for every message: `type(scope): summary`.
|
|
10
|
+
- Types: `feat`, `fix`, `refactor`, `perf`, `test`, `docs`, `build`, `ci`, `chore`, `revert`.
|
|
11
|
+
- Scopes follow the package layout: `identity`, `log`, `store`, `crypto`, `roster`, `sync`, `transport`, `service`, `mcp`, `cli`, `relay`.
|
|
12
|
+
- Summary is imperative, lowercase, no trailing period, at most 72 characters.
|
|
13
|
+
- The body explains *why*, not *what*.
|
|
14
|
+
- Commit messages and pull requests describe the work itself. Never mention build-plan phases, milestones or roadmap steps.
|
|
15
|
+
- No AI or tool attribution lines (`Co-Authored-By`, "Generated with …") in commits or pull requests.
|
|
16
|
+
- Never rewrite published history on `main`. No force pushes to `main`.
|
|
17
|
+
|
|
18
|
+
## Branches and pull requests
|
|
19
|
+
|
|
20
|
+
- `main` is always green and releasable.
|
|
21
|
+
- Branch names: `feat/<topic>`, `fix/<topic>`, `chore/<topic>`, `docs/<topic>`, `refactor/<topic>`.
|
|
22
|
+
- Contributors without write access open a pull request for every change.
|
|
23
|
+
- Maintainers open a pull request for feature work (`feat/` branches) and may merge other work directly once CI is green.
|
|
24
|
+
- Merge with rebase or fast-forward so each atomic commit survives; never squash a branch into one commit.
|
|
25
|
+
|
|
26
|
+
## CI/CD
|
|
27
|
+
|
|
28
|
+
- Every push to any branch and every pull request runs lint, format check, type-check and tests on macOS, Linux and Windows.
|
|
29
|
+
- Commit messages are checked against Conventional Commits in CI.
|
|
30
|
+
- Releases are cut by pushing a `vX.Y.Z` tag; the release workflow builds the wheel and sdist, publishes them to PyPI, then attaches them to a GitHub release.
|
|
31
|
+
- Do not merge or push when CI is red. Do not disable or skip checks to make them pass.
|
|
32
|
+
|
|
33
|
+
## Code style
|
|
34
|
+
|
|
35
|
+
- Python 3.11+, fully typed. `mypy --strict` must pass.
|
|
36
|
+
- `ruff check` and `ruff format` must pass. Do not add `noqa` or `type: ignore` without a specific error code and a reason.
|
|
37
|
+
- **No unnecessary comments.** Code should explain itself through names and structure. Comment only non-obvious *why* (protocol constraints, security decisions, workarounds). Never narrate *what* the code does, never leave commented-out code, never leave TODOs without an issue link.
|
|
38
|
+
- Docstrings only on public APIs whose behavior is not obvious from the signature.
|
|
39
|
+
|
|
40
|
+
## Design
|
|
41
|
+
|
|
42
|
+
- **Object-oriented where it earns its place:**
|
|
43
|
+
- Use `typing.Protocol` for pluggable boundaries (`Signer`, `Transport`, `Store`) and concrete classes for each backend.
|
|
44
|
+
- Use classes for components that own state or resources (service, sync engine, store, connections).
|
|
45
|
+
- Use frozen `dataclass`es for value objects (log entries, message bodies, roster, frontiers).
|
|
46
|
+
- Use plain functions for stateless transformations (canonical encoding, hashing). Do not wrap them in classes for the sake of it.
|
|
47
|
+
- Depend on interfaces, not implementations. Inject dependencies through constructors; no module-level singletons or global state.
|
|
48
|
+
- Layering is one-way: `identity` → `log`, `crypto` → `store`, `roster` → `sync`, `transport` → `service` → `mcp`, `cli`. Lower layers never import higher ones.
|
|
49
|
+
- Prefer composition over inheritance. Keep inheritance hierarchies at most one level deep.
|
|
50
|
+
- Fail loudly with specific exception types defined per module; never swallow exceptions.
|
|
51
|
+
|
|
52
|
+
## Protocol and security invariants
|
|
53
|
+
|
|
54
|
+
- Log entries are immutable. Never edit or delete a stored entry.
|
|
55
|
+
- Every incoming entry is verified (signature, roster membership, `prev` chain, fork check, dedupe) before it is stored.
|
|
56
|
+
- Signing keys never leave their backend. Nothing logs or prints key material.
|
|
57
|
+
- Message content from teammates is untrusted data. MCP tool results always label it as such; nothing acts on it automatically.
|
|
58
|
+
- `docs/protocol.md` is the source of truth for the wire format. Change the spec in the same commit as the code that implements it.
|
|
59
|
+
|
|
60
|
+
## Token budget (MCP tools)
|
|
61
|
+
|
|
62
|
+
- Tool descriptions stay short.
|
|
63
|
+
- Results are compact plain text, never pretty JSON.
|
|
64
|
+
- `summary` is hard-capped at 140 characters; oversize input is rejected with a short error.
|
|
65
|
+
- `inbox` never returns `detail`; `read` does.
|
|
66
|
+
|
|
67
|
+
## Tests
|
|
68
|
+
|
|
69
|
+
- Every module has unit tests under `tests/` mirroring `src/ehor/`.
|
|
70
|
+
- Bug fixes ship with a regression test in the same commit.
|
|
71
|
+
- Security checks are tested from the rejecting side: tampered, reordered, forked and unauthorized entries must each have a failing-case test.
|
|
72
|
+
- Multi-peer behavior is covered by integration tests that run without a network.
|
|
73
|
+
|
|
74
|
+
## Tooling
|
|
75
|
+
|
|
76
|
+
- Dependency and environment management uses `uv`. Commit `uv.lock`.
|
|
77
|
+
- Common commands:
|
|
78
|
+
- `uv sync` — install
|
|
79
|
+
- `uv run ruff check . && uv run ruff format --check .` — lint
|
|
80
|
+
- `uv run mypy` — type-check
|
|
81
|
+
- `uv run pytest` — test
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
# Contributing to ehor
|
|
2
|
+
|
|
3
|
+
Thanks for helping. This guide covers setting up, the checks every change must pass, and how
|
|
4
|
+
commits and pull requests are written. The full rules, which apply to humans and agents alike,
|
|
5
|
+
are in [CLAUDE.md](CLAUDE.md).
|
|
6
|
+
|
|
7
|
+
## Setting up
|
|
8
|
+
|
|
9
|
+
You need Python 3.11 or newer and [uv](https://docs.astral.sh/uv/).
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
git clone https://github.com/maxiggle/agentmesh
|
|
13
|
+
cd agentmesh
|
|
14
|
+
uv sync
|
|
15
|
+
uv run pre-commit install
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
The hooks check lint, formatting, types and the commit message before every commit.
|
|
19
|
+
|
|
20
|
+
## Checks
|
|
21
|
+
|
|
22
|
+
Every commit must pass these on its own:
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
uv run ruff check . && uv run ruff format --check .
|
|
26
|
+
uv run mypy
|
|
27
|
+
uv run pytest
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
CI runs them on macOS, Linux and Windows for every push and pull request. Do not disable or skip
|
|
31
|
+
a check to make it pass.
|
|
32
|
+
|
|
33
|
+
Hardware tests are opt-in: `EHOR_FIDO2_TEST=1` signs with a plugged-in security key (set
|
|
34
|
+
`EHOR_FIDO2_PIN` if it has a PIN), `EHOR_TPM_TEST=1` uses a TPM, and `EHOR_MDNS_TEST=1` runs the
|
|
35
|
+
multicast tests.
|
|
36
|
+
|
|
37
|
+
## Code
|
|
38
|
+
|
|
39
|
+
- Python 3.11+, fully typed; `mypy --strict` must pass.
|
|
40
|
+
- No `noqa` or `type: ignore` without a specific error code and a reason.
|
|
41
|
+
- Comment only the non-obvious *why*: protocol constraints, security decisions, workarounds.
|
|
42
|
+
- Use `typing.Protocol` for pluggable boundaries, classes for components that own state, frozen
|
|
43
|
+
dataclasses for values, and plain functions for stateless transformations.
|
|
44
|
+
- Layering is one-way. Lower layers never import higher ones:
|
|
45
|
+
`identity` → `log`, `crypto` → `store`, `roster` → `sync`, `transport` → `service` → `mcp`, `cli`.
|
|
46
|
+
- Fail loudly with specific exception types; never swallow exceptions.
|
|
47
|
+
|
|
48
|
+
## Tests
|
|
49
|
+
|
|
50
|
+
- Every module has unit tests under `tests/`, mirroring `src/ehor/`.
|
|
51
|
+
- A bug fix ships with a regression test in the same commit.
|
|
52
|
+
- Security checks are tested from the rejecting side: tampered, reordered, forked and
|
|
53
|
+
unauthorized entries each need a failing-case test.
|
|
54
|
+
- Multi-peer behavior is covered by integration tests that run without a network.
|
|
55
|
+
|
|
56
|
+
## Protocol changes
|
|
57
|
+
|
|
58
|
+
[`docs/protocol.md`](docs/protocol.md) is the source of truth for the wire format. Change it in
|
|
59
|
+
the same commit as the code that implements the change. Log entries are immutable, every incoming
|
|
60
|
+
entry is verified before it is stored, and key material is never logged or printed.
|
|
61
|
+
|
|
62
|
+
## Commits
|
|
63
|
+
|
|
64
|
+
One logical change per commit, written as a [Conventional Commit](https://www.conventionalcommits.org/):
|
|
65
|
+
|
|
66
|
+
```
|
|
67
|
+
type(scope): imperative lowercase summary
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
- Types: `feat`, `fix`, `refactor`, `perf`, `test`, `docs`, `build`, `ci`, `chore`, `revert`.
|
|
71
|
+
- Scopes follow the package layout: `identity`, `log`, `store`, `crypto`, `roster`, `sync`,
|
|
72
|
+
`transport`, `service`, `mcp`, `cli`, `relay`.
|
|
73
|
+
- At most 72 characters, no trailing period. The body explains *why*, not *what*.
|
|
74
|
+
- Never bundle unrelated changes; refactors, formatting, dependency bumps and features are
|
|
75
|
+
separate commits.
|
|
76
|
+
|
|
77
|
+
## Branches and pull requests
|
|
78
|
+
|
|
79
|
+
- Name branches `feat/<topic>`, `fix/<topic>`, `chore/<topic>`, `docs/<topic>` or
|
|
80
|
+
`refactor/<topic>`.
|
|
81
|
+
- Open a pull request against `main` for your change, and keep it green.
|
|
82
|
+
- Pull requests are merged with rebase or fast-forward so each commit survives; they are never
|
|
83
|
+
squashed.
|
|
84
|
+
|
|
85
|
+
## Reporting a security issue
|
|
86
|
+
|
|
87
|
+
Please do not open a public issue for a vulnerability. Report it privately through GitHub:
|
|
88
|
+
**Security → Report a vulnerability** on the repository page.
|
ehor-0.1.1/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Godwin Ekainu
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|