docs: add CONVENTIONS.md structure & taste guide#323
Draft
Troublor wants to merge 1 commit into
Draft
Conversation
Cross-cutting code-organization reference for mega-evm: module-by-layer map, file-role conventions, composition idioms (registry-of-trackers, macro-wrapped instruction table, spec-gating), when to add a new file vs. extend one, readability mechanisms, and a smell list. Includes a 'How to use' split between PR-gate and repo-level-audit modes, a repo-wide scan plan, and a 'Known deviations & improvement backlog' (section 8) so repo-level reviews can mine documented tech debt rather than treat it as convention. Wire it in: pointers from AGENTS.md (Core Source Layout) and REVIEW.md (Design and architecture), and add it to the doc-audit/doc-impact agent-file scope so freshness/correctness checks keep it current.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
CONVENTIONS.mdat the repo root — a cross-cutting code-organization & taste guide formega-evm. It covers: a module-by-execution-layer map ("adding X → it belongs in module Y"), file-role conventions (mod.rsas a wiring façade, thefactory.rs/result.rs/error.rs/helpers.rsrole names), composition idioms (registry-of-trackers, macro-wrapped instruction table, trait factories, spec-gating), when to add a new file vs. extend one, readability/maintainability mechanisms, and a smell list.StateChangeSource::Transaction(0)placeholder, dead commented-outincrement_balancescode, duplicateddata_size/kv_updatetracker bodies,sandbox/missing its nestedAGENTS.md) so repo-level reviews mine documented deviations instead of mistaking them for endorsed convention.AGENTS.md(Core Source Layout) andREVIEW.md(Design and architecture), and addCONVENTIONS.mdto thedoc-audit.yml/claude.ymlagent-file scope so the freshness/correctness audits keep it current.Test plan
spec:unchanged,api:unchanged).markdownlint-cli2passes with 0 errors;prettier --check 'docs/**/*.md' '*.md'is clean.mainat authoring time.