Skip to content

docs: record the module-shape, cleanup, and review-shape conventions - #735

Open
lneto wants to merge 8 commits into
masterfrom
claude_agents_conformance
Open

docs: record the module-shape, cleanup, and review-shape conventions#735
lneto wants to merge 8 commits into
masterfrom
claude_agents_conformance

Conversation

@lneto

@lneto lneto commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Conventions the tree already follows but AGENTS.md did not record, each drawn from a place a review missed them.

Lua style

  • A module that makes objects returns a class or namespace table and constructs through .new or a :__call method on the class (hkdf, inet), never a bare function or a metatable wrapped around the module; the underlying handle sits in a named field, not one prefixed with an underscore; the instance metatable is named for what it is, not mt.
  • A proxy's metamethods do not allocate per access, as bpf.map's view shows.
  • CAPS <const> marks a scalar; a lookup, dispatch, or allow-list table is a lowercase name by role (codecs, tokens), never caps.

Deciding what to change

  • A function's contract — read-only, never-sleeps, what it returns — is read from its body, not inferred from its name or its place in a method table (connmark reads and writes despite sitting among read-only accessors).
  • A call the conventions here already settle is decided and noted, not escalated; a question is reserved for a genuine fork no rule, precedent, or test resolves.

Tests

  • The cleanup undoes everything any case can create, not only what the happy path stops inline, so a case that fails before its own teardown does not wedge the next run.

Reviewing

  • A new module is read for its shape against its nearest sibling, not only its logic; correct code in a shape the tree does not use is a finding, and confirming the shape means grepping for the peer.
  • The base can be the outdated one: when new code diverges from it, check which side is right before aligning, rather than pulling the new code down to match a sibling that is itself behind.

Docs only.

  • A re-review re-fetches the author's branch and reads what changed there, not the review branch you built last round.
  • Once it is clean, the verdict that a PR can merge is an Approve, not a comment saying it looks good.
  • Being told to post is not a license to post words the maintainer has not read: show the exact text, get the go-ahead on it, then post.
  • An artifact with no test of its own (example, script) is run directly before a verdict, not just built.
  • Reshaping or renaming an API means updating every consumer, including ones in stacked pull requests.

lneto and others added 4 commits August 19, 2026 21:17
A module that makes objects returns a class or namespace table and constructs
through .new or a :__call method; a proxy's metamethods do not allocate per
access. A test's cleanup covers every case's runtime, not only the happy path's,
so a case that fails before its inline teardown does not wedge the next run. A
review measures a new module's shape against its nearest sibling, not only its
logic.
A CAPS <const> marks a scalar; a lookup or allow-list table is a lowercase
name by role. A function's contract is read from its body, not inferred from
its name or its place in a method table.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
A call the conventions here already answer is decided and noted, not put to the
maintainer; a question is reserved for a genuine fork no rule, precedent, or test
resolves.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
When new code diverges from the base, check which side is right before aligning;
pulling it down to match a sibling that is itself behind is the wrong fix.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@lneto
lneto force-pushed the claude_agents_conformance branch from 06f3ea5 to 74c6a06 Compare August 22, 2026 12:28
lneto and others added 4 commits August 23, 2026 15:50
When the pull request updates, re-fetch the author's branch and diff their new
head against what you last saw; re-reading your own review branch reviews your
work, not theirs.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
A comment saying it looks good leaves an earlier request-for-changes standing
and the merge gate closed; the approval is what clears it.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Show the exact text and get the go-ahead on it before posting; the approval is
of the words, not the intent.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…onsumer

An artifact with no test of its own is run directly before a verdict, not just
built. Reshaping or renaming an API means updating every consumer, grepped for,
including ones in stacked pull requests that rebase onto the change.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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