Skip to content

Add the agent, contributor and security rules, and format and lint the Erlang code - #92

Merged
benoitc merged 5 commits into
mainfrom
chore/agent-rules
Nov 26, 2026
Merged

benoitc merged 5 commits into
mainfrom
chore/agent-rules

Conversation

@benoitc

@benoitc benoitc commented Nov 26, 2026

Copy link
Copy Markdown
Owner

erlang_python had no written rules for agents, no security policy, and no formatter or linter. Style drifted, and nothing said where a bug ends and a vulnerability starts. This brings over what erlang_quic uses, adapted to a library that runs Python inside the VM.

The Erlang sources are formatted with erlfmt and linted with Elvis, and the Lint job checks both. The reformat is its own commit and changes no code. Elvis exempts, rule by rule, the modules that broke a rule when it was adopted, so new modules follow every rule. AGENTS.md holds the rules for agents, and CLAUDE.md points to it. The contributor guide moves to CONTRIBUTING.md and gains erlang_quic's rules for contributors. SECURITY.md draws the line: anything Python code can do is a bug, since Python holds the authority of the user running the node.

No breaking changes. A branch open against main will conflict with the reformat; run rebar3 fmt on it before merging main in.

Adopt the formatter erlang_quic uses: rebar3 fmt rewrites src, test,
examples, scripts and rebar.config, and the Lint job now fails on code
it would change. Apart from the plugin and CI lines, this commit only
reformats.
elvis.config takes erlang_quic's rule set. The modules that broke a rule
when it was adopted are exempted per rule, so a new module follows all
of them and the lists only shrink. Two map_size comparisons now use =:=
and py_venv's one-line Python programs are split under 120 columns. The
Lint job runs rebar3 lint.
The guide moves to the root, where GitHub shows it on issues and pull
requests, and takes erlang_quic's rules for contributors: write for the
person who reads it, what AI tools may do, which reports are bugs rather
than security issues, branch and commit conventions, one pull request
with a commit per step, and how a release is made. make lint-docs now
checks it too.
SECURITY.md says what to report privately: memory corruption or code
execution from data passing through the library, or code loaded from a
place the configuration did not name. Anything Python code can do is a
bug, because Python holds the authority of the user running the node,
as the sandbox and isolated mode guides already say.
AGENTS.md gathers what an agent must know before changing the code: a
NIF bug is the node's, so a fix covers the whole defect class and proves
its mechanism with a test; Python code is not a security boundary; the
checks CI gates on and the CMake cache trap; how tests, plans, commits,
pull requests and releases are done. CLAUDE.md points to it.
@benoitc
benoitc merged commit ccc1ca6 into main Nov 26, 2026
20 checks passed
@benoitc benoitc mentioned this pull request Nov 26, 2026
@benoitc
benoitc deleted the chore/agent-rules branch November 26, 2026 22:43
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.

1 participant