Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 0 additions & 65 deletions .agents/skills/hyperlane/SKILL.md

This file was deleted.

63 changes: 63 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# AGENTS.md — Hyperlane Architecture & Standards

Mandatory architectural, engineering, formatting, verification, and documentation governance rules for all contributors and AI coding agents working in `hyperlane`.

---

## 1. Project Architecture

`hyperlane` is a unified Rust 2024 Cargo workspace (`Cargo.toml`) delivering a cross-platform (Linux, macOS, Windows) multi-protocol asynchronous HTTP server framework (`HTTP/1.x`, `HTTP/2`, `HTTP/3`), standalone HTTP client, procedural macro suite, developer CLI, benchmark harness, and an opt-in plugin ecosystem.

- **Root-Cause Redesign Over Patchwork**: Fix architectural, protocol, and transport flaws at their source in core and wire layers rather than layering workarounds in route handlers or plugins.

| Crate / Module | Path | Architectural Responsibility |
| :------------- | :------------- | :----------------------------------------------------------------------------------------- |
| Facade | `src/` | Re-exports server core and procedural macros; contains no protocol or middleware logic. |
| Constants | `constant/` | Zero-dependency canonical HTTP protocol constants shared across the workspace. |
| Compression | `compress/` | Leaf bounded compression codecs and content-encoding negotiation without runtime coupling. |
| Wire Types | `type/` | RFC-compliant HTTP wire types, parsers, builders, and transport primitives. |
| HTTP Client | `request/` | Standalone sync and async HTTP client layered on wire types without server-core coupling. |
| Server Core | `core/` | Multi-protocol async server engine, router, request context, and hook lifecycle. |
| Proc Macros | `macros/` | Procedural attribute macros for routing, lifecycle hooks, and middleware registration. |
| Developer CLI | `cli/` | Workspace formatting, project scaffolding, template management, and watch tooling. |
| Benchmarks | `performance/` | Reproducible native and container throughput, latency, and allocation benchmark harness. |
| Plugin Suite | `plugin/*/` | Opt-in, mutually decoupled framework plugins with zero inter-plugin dependencies. |

---

## 2. Core Engineering Standards

### 2.1 Protocol, API & Plugin Architecture Standards

- **Strict Acyclic Layering**: Preserve one-way workspace dependency flow from leaf constants and codecs through wire types to server core, client, facade, and independent plugins.
- **Encapsulation & Visibility**: Keep internal transport, listener, TLS, and protocol modules crate-private, and keep fields on public structs crate-private behind generated accessors.
- **Wire & Lifecycle Contracts**: Keep route and middleware registration synchronous, propagate server bind failures, maintain strict RFC wire and decompression safety bounds, and send response bytes before rejecting downstream pipelines.
- **Opt-In Plugin Transparency**: Every plugin MUST remain inactive and transparent when unconfigured, avoid hook-priority collisions, and be registered in `Cargo.toml` and release CI workflows when publishable.
- **Hygienic Macro Codegen**: Procedural macro expansions MUST use fully qualified crate paths, emit zero `use` statements, and stay free of redundant generated documentation bloat.

### 2.2 Quality, Tooling & Hygiene Standards

- **Rust Engineering Standards**: Follow `~/.agents/skills/rust-standards` without exception.
- **Idempotent Unified Formatting**: Keep workspace formatting layered on `crate-cli` via `hyperlane fmt`, `crate fmt`, and `cargo fmt` with double-run idempotency across Rust and repository text formats.
- **Pure English & Git Hygiene**: Keep all code, comments, documentation, commits, and PR text pure English per `~/.agents/skills/git-standards`, and never bypass repository git hooks.
- **Clean Artifacts & Test Hygiene**: Exercise real wire bytes for protocol changes, reclaim all spawned listeners and child processes on exit, and never commit build, certificate, or benchmark outputs.

---

## 3. Governance, Skills & Verification

Keep human-facing `README.md`, crate `README.md`, and `plugin/README.md` files strictly free of AI/agent governance per `~/.agents/skills/agents-standards`. Project skills are centralized under `~/.agents/skills/`:

| Skill | Directory | Domain |
| :------------------------ | :----------------------------------------- | :------------------------------------------------------------------ |
| `hyperlane` | `~/.agents/skills/hyperlane` | Hyperlane architecture, server/wire/plugin standards & release flow |
| `agents-standards` | `~/.agents/skills/agents-standards` | `AGENTS.md`, global skill, and `README.md` governance standards |
| `rust-standards` | `~/.agents/skills/rust-standards` | Mandatory Rust module layout, typing, linting & safety gates |
| `git-standards` | `~/.agents/skills/git-standards` | Pure-English commits, hook compliance & branch policy |
| `gh-pr-creation-workflow` | `~/.agents/skills/gh-pr-creation-workflow` | Pull request creation, CI verification & squash-merge delivery |

### Mandatory Pre-Merge Gate Sequence

1. **Formatting**: Run `cargo run -p hyperlane-cli -- fmt` twice, then verify zero diffs with `cargo run -p hyperlane-cli -- fmt --check`, `crate fmt --check`, and `cargo fmt --all -- --check`.
2. **Static Analysis & Tests**: Pass `cargo clippy --workspace --all-features --all-targets -- -D warnings`, `cargo test --workspace --all-features`, `cargo check --release --workspace --all-features`, and all gates in `~/.agents/skills/rust-standards`, `~/.agents/skills/agents-standards`, and `~/.agents/skills/git-standards`.
3. **Version Bump & Delivery**: Bump `[workspace.package].version` and internal `[workspace.dependencies]` pins together in `Cargo.toml`, synchronize affected docs (`README.md`, `plugin/README.md`, `AGENTS.md`), and deliver per `~/.agents/skills/git-standards` and `~/.agents/skills/gh-pr-creation-workflow`.
5 changes: 0 additions & 5 deletions CLAUDE.md

This file was deleted.

16 changes: 8 additions & 8 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ categories = ["network-programming", "web-programming"]
exclude.workspace = true

[workspace.package]
version = "23.3.1"
version = "23.3.2"
readme = "README.md"
edition = "2024"
authors = ["root@devhub.vip"]
Expand Down Expand Up @@ -86,13 +86,13 @@ members = [
]

[workspace.dependencies]
hyperlane = { path = ".", version = "23.3.1" }
http-type = { path = "type", version = "23.3.1" }
hyperlane-core = { path = "core", version = "23.3.1" }
http-request = { path = "request", version = "23.3.1" }
http-compress = { path = "compress", version = "23.3.1" }
http-constant = { path = "constant", version = "23.3.1" }
hyperlane-macros = { path = "macros", version = "23.3.1" }
hyperlane = { path = ".", version = "23.3.2" }
http-type = { path = "type", version = "23.3.2" }
hyperlane-core = { path = "core", version = "23.3.2" }
http-request = { path = "request", version = "23.3.2" }
http-compress = { path = "compress", version = "23.3.2" }
http-constant = { path = "constant", version = "23.3.2" }
hyperlane-macros = { path = "macros", version = "23.3.2" }

h3 = "0.0.8"
h2 = "0.4.20"
Expand Down
Loading
Loading