Skip to content

feat: devex help, add Makefile, ruff, pre-commit, and modernize CI#801

Closed
OutThisLife wants to merge 1 commit into
mainfrom
feat/devex-help
Closed

feat: devex help, add Makefile, ruff, pre-commit, and modernize CI#801
OutThisLife wants to merge 1 commit into
mainfrom
feat/devex-help

Conversation

@OutThisLife

Copy link
Copy Markdown
Collaborator

What does this PR do?

Adds a proper dev toolchain — Makefile command surface, ruff formatting/linting,
pre-commit hooks, and modernized CI. Contributors now run make setup + make check
instead of memorizing ad-hoc commands.

Related Issue

N/A — devex improvement

Type of Change

  • ♻️ Refactor (no behavior change)

Changes Made

  • Makefile — setup, sync, clean, lint, fmt, check, test, test-fast, test-watch, dev-cli, dev-gateway
  • pyproject.toml — ruff config (lint rules, isort, per-file ignores), dev deps (ruff, pre-commit, watchfiles)
  • .pre-commit-config.yaml — ruff lint/format + hygiene hooks
  • .editorconfig — 4-space Python, 2-space YAML, tabs for Makefile, LF
  • .github/workflows/tests.yml — split into lint (uvx ruff, zero-install) + test (uv cache) jobs
  • .gitignore — deduplicated and organized
  • README.md, CONTRIBUTING.md, AGENTS.md, website docs, PR template, platform guide — standardized on make commands
  • 104 source files — ruff format + import sorting + type annotation modernization
  • tools/delegate_tool.py — fixed callable | NoneCallable | None (runtime crash on 3.11)
  • batch_runner.py — added from __future__ import annotations for Lock | None
  • gateway/__init__.py — fixed SessionResetPolicy import (was importing from wrong module)

How to Test

  1. make setup from a fresh clone
  2. make check — lint + test should both pass
  3. make dev-cli — verify file-watch restart works

Checklist

Code

  • I've read the Contributing Guide
  • My commit messages follow Conventional Commits
  • I searched for existing PRs to make sure this isn't a duplicate
  • My PR contains only changes related to this fix/feature
  • I've run make check and all checks pass
  • I've tested on my platform: WSL2 Ubuntu

Documentation & Housekeeping

  • I've updated relevant documentation (README, CONTRIBUTING, AGENTS.md, website docs)
  • I've considered cross-platform impact

@OutThisLife OutThisLife requested a review from teknium1 March 10, 2026 17:44
@teknium1

Copy link
Copy Markdown
Contributor

Closing — the tooling additions (Makefile, ruff config, pre-commit, CI) have merit, but this PR bundles them with mass reformatting of 104 source files (~21k lines of churn). That's not something we want right now:

  • Destroys git blame across the entire codebase
  • 209 commits behind main — unmergeable
  • All three claimed bug fixes are already resolved on main
  • Creates merge conflicts for every in-flight PR

If you'd like to resubmit the tooling-only pieces (Makefile, pyproject.toml ruff config, .editorconfig, .pre-commit-config.yaml, CI modernization) as a separate PR without any source file formatting changes, we'd be happy to review that. The ruff config can exist in pyproject.toml for contributors to use locally without enforcing a mass reformat.

Thanks for the effort @OutThisLife — the Makefile and CI improvements are genuinely useful, just need to be decoupled from the formatting pass.

@teknium1 teknium1 closed this Mar 11, 2026
@OutThisLife

Copy link
Copy Markdown
Collaborator Author

reopened w/o formatting included, that can be another pass #969

lmsanch added a commit to lmsanch/hermes-agent that referenced this pull request Apr 22, 2026
…play protection (NousResearch#718) (#6)

Operationalizes the A2A cryptographic identity spec in
docs/strategic/A2A_CRYPTO_IDENTITY.md (filed as toryx-private#820).
This is the module downstream issues NousResearch#801, NousResearch#802, and NousResearch#812 integrate
against; it replaces the env-var trust shim in research_mcp whitelist.

New module `tools/agent_identity.py`:

- generate_identity(profile_name, force=False)
  Writes an Ed25519 private key (PKCS8 PEM) to
  ~/.hermes/profiles/<profile>/keys/ed25519_private.pem (chmod 600) and
  registers the raw public key in ~/.hermes/identity_registry.yaml.
  Refuses overwrite without force=True so rotation is explicit.

- sign_envelope(profile_name, recipient, body, host=None)
  Canonical-JSON envelope per spec §4: sender_agent, sender_host,
  recipient_agent, nonce (128 bit hex), timestamp (ISO8601 UTC),
  body_sha256, body, signature. Signature covers everything except the
  signature field itself.

- verify_envelope(envelope)
  Per spec §5 verification flow: missing-fields check → timestamp window
  (5 min) → body_sha256 integrity → nonce LRU replay (10k entries) →
  pubkey lookup → Ed25519 verify. On ANY failure returns non-valid
  result — callers drop silently, no reply (prevents loop amplification
  + reply-ack exfil per NousResearch#716 lessons).

- canonical_json(obj)
  Exposed utility — sorted keys, UTF-8, no whitespace. Same shape as the
  toryx-openratings anchor payload canonical form.

Tests:
- Round-trip sign/verify
- Replay rejection (same nonce twice)
- Timestamp-out-of-window rejection
- Unknown sender rejection
- Bad signature rejection
- Tampered body rejection (body_sha256 integrity catch)
- Missing fields rejection
- Canonical JSON is deterministic across key orderings
- Two-agent talk (cross-identity verification)
- Nonce LRU eviction semantics

Not in scope (v2):
- Key rotation with 30-day pubkey overlap
- HSM-backed private key storage
- Transport bindings (telegram X-header, email header, consult_colleague
  inline field) — those land in each platform adapter

Closes lmsanch/toryx-private#718
lmsanch added a commit to lmsanch/hermes-agent that referenced this pull request May 23, 2026
…play protection (NousResearch#718) (#6)

Operationalizes the A2A cryptographic identity spec in
docs/strategic/A2A_CRYPTO_IDENTITY.md (filed as toryx-private#820).
This is the module downstream issues NousResearch#801, NousResearch#802, and NousResearch#812 integrate
against; it replaces the env-var trust shim in research_mcp whitelist.

New module `tools/agent_identity.py`:

- generate_identity(profile_name, force=False)
  Writes an Ed25519 private key (PKCS8 PEM) to
  ~/.hermes/profiles/<profile>/keys/ed25519_private.pem (chmod 600) and
  registers the raw public key in ~/.hermes/identity_registry.yaml.
  Refuses overwrite without force=True so rotation is explicit.

- sign_envelope(profile_name, recipient, body, host=None)
  Canonical-JSON envelope per spec §4: sender_agent, sender_host,
  recipient_agent, nonce (128 bit hex), timestamp (ISO8601 UTC),
  body_sha256, body, signature. Signature covers everything except the
  signature field itself.

- verify_envelope(envelope)
  Per spec §5 verification flow: missing-fields check → timestamp window
  (5 min) → body_sha256 integrity → nonce LRU replay (10k entries) →
  pubkey lookup → Ed25519 verify. On ANY failure returns non-valid
  result — callers drop silently, no reply (prevents loop amplification
  + reply-ack exfil per NousResearch#716 lessons).

- canonical_json(obj)
  Exposed utility — sorted keys, UTF-8, no whitespace. Same shape as the
  toryx-openratings anchor payload canonical form.

Tests:
- Round-trip sign/verify
- Replay rejection (same nonce twice)
- Timestamp-out-of-window rejection
- Unknown sender rejection
- Bad signature rejection
- Tampered body rejection (body_sha256 integrity catch)
- Missing fields rejection
- Canonical JSON is deterministic across key orderings
- Two-agent talk (cross-identity verification)
- Nonce LRU eviction semantics

Not in scope (v2):
- Key rotation with 30-day pubkey overlap
- HSM-backed private key storage
- Transport bindings (telegram X-header, email header, consult_colleague
  inline field) — those land in each platform adapter

Closes lmsanch/toryx-private#718
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants