9.9 KiB
honk LLM Contribution Policy
Status: project policy for daeuniverse/honk. Adapted from the rust-lang/rust LLM policy (2026-08), calibrated to honk's actual development model: a small human core team writing architecture and soundness-critical code, with LLM agents producing high-volume supporting code under review.
This policy exists so that contributors know the rules before they write code, and so reviewers can point to a public, actionable reason when enforcing them. It is not a stance on whether LLMs are good or bad; it is a statement of where understanding must live in this project.
1. Core principle
LLMs may fill; humans must own the invariants.
It is fine to use LLMs to answer questions, analyze, distill, refine, check, suggest, review, and to generate code in the areas listed in §3. LLM-originated changes in the soundness-critical areas listed in §2 are prohibited by default; the domain-expert exception in §11 is the only exception.
The project cares more about authors understanding what the code does, planning how it will change, and deciding what it should look like, than about the code itself. A polished PR is not evidence of any of these.
2. Soundness-critical areas (human-originated by default)
The following carry honk's core invariants — generation ownership, lock ordering, eBPF two-phase commit semantics, failure-direction guarantees. Changes here must be originated by a human who can defend the design line by line, unless the domain-expert exception in §11 applies. Outside that exception, LLMs may analyze, review, and suggest, but must not create the change:
crates/honk-ebpf/(kernel programs, datapath state transitions, token semantics)crates/honk-core/src/ebpf/(real backend, map lifecycle, routing push plans)crates/honk-ebpf-common/(shared kernel/userspace ABI, ayaPodimplementations)crates/honk-core/src/control/reload/(transaction, fingerprints, retention decisions)crates/honk-core/src/control/routing_matcher.rsand the eBPF publication pipeline- Lock acquisition order across
config,router,datapath_flagspublication,ebpf,group_manager,outbound_id_map,active_routing_plan,runtime_registry,reload_lock(the actual publication sequence is documented indoc/en/design/control-plane.md) unsafecode anywhere in the repository- Failure/replay/degradation paths (datapath health, drain, NFQUEUE fencing)
Rationale: these areas fail in directions a diff cannot show. Their correctness depends on invariants that live across files, in AGENTS.md, and in reviewer memory — not in any single hunk.
3. LLM-created code (allowed, with conditions)
LLM-generated code is welcome in:
- Test units, integration tests, fault-injection fixtures
- Benchmarks and CI gates/scripts
- Mock backends and test harnesses
- Documentation,
AGENTS.mdand.agents/rules/updates - Mechanical, behavior-preserving refactors outside §2 areas
Conditions (all mandatory):
- Pre-arranged. The change fits an agreed division of labor, not a drive-by PR.
- Disclosed. The PR description states whether AI was used (see §5). Undisclosed AI use is grounds for closing.
- Tested. Any LLM-created production-adjacent code (fixtures, mocks that other tests depend on) must itself be exercised by CI. Benchmarks must carry their contract assertions in-tree.
- Human-reviewed. A human maintainer has read the diff. LLM review never substitutes for human review or self-review.
- Invariants respected. LLM-created code must obey every contract in
AGENTS.md(e.g. generation-bound ownership; no new lock edges). Reviewers should assume the generator generalized the contract imperfectly and check the seams.
4. Review rules
- Human review is the merge gate. LLM reviews (including external adversarial reviews) are advisory layers; at least one maintainer must approve with human judgment.
- No mechanical relay. Do not respond to review comments by pasting them into an LLM and pasting the answer back. If we wanted an LLM's opinion we would ask it ourselves. We want your reasoning.
- Fast review owns the shallow, slow review owns the deep. Maintainers' quick review of LLM filler code is expected to catch contract violations visible in the diff. Defect classes structurally invisible to fast review — negative-space omissions, cross-file invariant conflicts, concurrency/timing — are the explicit responsibility of the deep-review layer (see §6) and must not be assumed covered.
- Tests must attack, not mirror. Reviewers of LLM-written tests should sample whether assertions are independently derived semantic claims (e.g. "old-generation entries survive one transition") or restatements of the implementation. Mirror tests are rejected regardless of coverage numbers.
- Reviewers may close non-compliant PRs with a pointer to this document, no questions asked.
5. Responsibility for AI-assisted work
AI may help with writing, analysis and review. Before submitting, the submitter must have read and tested everything, understand every line, and answer for it. State in the pull request whether AI helped write it; which files it wrote need not be listed.
Start the pull request body from .github/pull_request_template.md, also when you open it with gh pr create --body or the API, which do not fill it in. Keep its checklist and check only true boxes. For an outside contributor, template-check closes a pull request that drops a required box, does not check exactly one of the two AI boxes, or checks the unread or AI-agent box, and reopens it once the body is fixed.
6. Adversarial deep review
PRs touching §2 areas, or modifying any invariant named in AGENTS.md, require a deep review pass in addition to normal review. The deep review must:
- Enumerate the negative space (inputs not fingerprinted, paths not gated, branches not tested);
- Verify failure direction (every new failure mode must fall toward the conservative side);
- Re-derive lock ordering if any lock site was added or moved;
- Cite findings by
file:lineand pin the reviewed head SHA.
An unbroken streak of "no findings" from any single reviewer — human or LLM — is itself a weak signal and increases the weight of an independent second pass.
7. What LLMs are for here (encouraged)
- Writing and expanding test matrices, fault injection, and benchmarks
- CI regression gates that turn performance/correctness claims into executable checks
- Keeping
AGENTS.mdand.agents/rules/synchronized with code changes - First-pass review, evidence audit, and adversarial second-pass review under human direction
- Analysis, translation, summarization — with the pull request stating that AI helped, as §5 requires; individual passages need not be marked
8. What LLMs are not for here
- Originating changes in §2 areas unless the domain-expert exception in §11 applies
- Substituting for the author's mental model of merged code
- Producing PR descriptions, issue text, or review replies posted without saying whether AI helped write them; one statement per pull request, issue or reply is enough, and the parts need not be listed
- Lowering any existing bar: clippy clean, passing the applicable CI and documented validation gates, and
AGENTS.md/.agents/rules/synchronization are required of LLM-assisted PRs exactly as of human ones. Use the gates in CI, the Justfile,AGENTS.mdand.agents/rules/, including only their explicitly documented temporary test exclusions. Disclosure and human review remain mandatory; LLM assistance is never a reason to skip required validation.
9. Enforcement and scope notes
- Maintainers are not responsible for detecting LLM authorship; that responsibility lies with the author. Style is not evidence; do not accuse contributors of LLM use. Suspected undisclosed use is reported privately to maintainers.
- Harassment over LLM use — allowed or not — is prohibited under this policy. Report it privately to maintainers.
- Some provisions are unenforceable. That is accepted: the goal is a bright line judged on actions (disclosure given or not), with intent considered only when deciding how to respond.
- This policy is easier to change than it was to adopt. Propose amendments by PR against this file.
10. The understanding clause
Merged code becomes the maintainer's burden. If you cannot explain, unprompted, what your PR does and why it is correct — including the parts an LLM wrote — the PR is not ready, regardless of how polished it is. We are building a community of deep experts in this codebase, not just artifacts that mechanically do the right thing.
11. Domain-expert exception
A human author who is already a domain expert in the affected area may use an LLM to originate a §2 change, provided that the author fully understands and stands behind every line before submitting it. This is the same exception referenced in §§1, 2, and 8, not a separate permission granted by each section.
The exception concerns only who originates the code. All conditions in §3, disclosure under §5, human maintainer approval under §4, and adversarial deep review under §6 still apply. The author retains responsibility for the design and its invariants; passing tests, LLM review, or relying on a maintainer to supply the missing understanding does not satisfy the exception.
Changelog
A PR that changes crates/, Cargo.toml, Cargo.lock, ci/fetch-doona.sh or .github/ci/pins.env adds a fragment at changes/<branch-slug>.md. changes/README.md gives the format, the exemptions and how fragments become CHANGELOG.md. CI fails without a fragment unless a maintainer applies the no-changelog label.
Release
Follow the release process to prepare a release.
No programmer tapes.