chore: contract-stack docs, error-doc CI, CODEOWNERS, and pre-commit ABI guard - #290
Merged
levoski1 merged 4 commits intoJul 26, 2026
Conversation
Add a short CONTRIBUTING.md section that helps contributors pick
between the canonical COMEBACKHERE-{contracts,backend,frontend} trees
and the older mirrored top-level {contracts,backend,frontend} trees.
The canonical trees are preferred because they have dedicated CI
workflows; the mirrored trees are still valid PR targets but lack
their own independent cargo/npm test runs and are referenced from
docs like docs/error-codes.md.
Link out to a new ARCHITECTURE.md for the full directory layout, the
CI checkout behaviour, and the gap in coverage on the mirrored trees.
Closes WHEELBACK#285
Add a small bash/awk grep-based script that walks every contract source in contracts/ and COMEBACKHERE-contracts/, finds every `*Error` enum block, and checks each variant against docs/error-codes.md. The script is deliberately not a Rust AST parser; it just needs to catch a variant added in code with no matching row in any error table. An ignore file (.check-error-codes-ignore) lets teams mark intentionally-undocumented test-only internals (default: the in-test StubError). Wired into a new CI workflow that runs on every PR that touches contract sources or this documentation. Also extend docs/error-codes.md with the three missing sections (TreasuryError, ContractError (invoice), ContractError (compliance)) so the check passes on the current state. Closes WHEELBACK#286
Add explicit @dreamgeneX ownership for COMEBACKHERE-contracts/ and abis/ so PRs touching fund-safety-critical contract code or the ABI metadata that drives the backend auto-request a review from the contract maintainer. Existing rules for contracts/, scripts/, docs/ are unchanged. Closes WHEELBACK#287
Add a new pre-commit hook (id: check-abi-snapshots) that runs `make check-abi-snapshots` whenever a staged file is inside COMEBACKHERE-contracts/contracts/ or abis/. Unlike the existing `abi-snapshot-hygiene` staging-pairing hook, this one actually rebuilds the contracts and diffs the metadata to ensure abis/ is content-fresh, not just that the right files moved together. A small wrapper script formats the failure message to point directly at `make update-abi-snapshots` so the remediation is unambiguous; the same script self-skips when the COMEBACKHERE-contracts sibling is not present locally so unrelated commits are not blocked. Closes WHEELBACK#288
Emmy6654
force-pushed
the
chore/contract-stack-tooling-and-governance
branch
from
July 25, 2026 13:59
36499ce to
3623d25
Compare
|
@Emmy6654 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
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.
Closes #281
Closes #282
Closes #283
Closes #284
Summary
Four small, orthogonal improvements across docs, error-code tooling, ownership, and pre-commit safety:
docs: document which app tree to contribute to— closes docs/feat: treasury hold docs, backend env validation, address schema check, mainnet dry-run #285Adds a short Which stack do I work on? section to CONTRIBUTING.md that points contributors at the canonical
COMEBACKHERE-{contracts,backend,frontend}trees and explains that the sibling-less top-levelcontracts/,backend/,frontend/trees are still valid PR targets but lack their own independent CI coverage. Links out to a new ARCHITECTURE.md for the full directory layout, the CI checkout behaviour, and where the gap in coverage shows up.chore: add ci check for error code documentation drift— closes feat(wallet): fully clear session state and state-gated views on disconnect #286Adds
scripts/check_error_docs_sync.shplus a new.github/workflows/ci-error-docs.yml. The script walks every*Errorenum incontracts/andCOMEBACKHERE-contracts/, extracts variants with awk/grep (no Rust AST parser), and fails on any variant name with no matching row in any table ofdocs/error-codes.md. A.check-error-codes-ignorefile allows intentionalenum:Nameorvar:Nameskips. Also extends the docs file with the three missing sections (TreasuryError; ContractError (invoice); ContractError (compliance)) so the check passes on the current clean state.chore: add codeowners rules for contract directories— closes addmotion #287Adds explicit
@dreamgeneXownership forCOMEBACKHERE-contracts/andabis/so PRs touching fund-safety-critical contract code or the ABI metadata that drives the backend auto-request a review from the contract maintainer. Existingcontracts/,scripts/,docs/rules are unchanged.chore: add pre commit hook for abi snapshot check— closes fix: fix silent failure in abi snapshot hygiene check #288Adds a new pre-commit hook (
id: check-abi-snapshots) wired to a small wrapper scriptscripts/check_abi_snapshots_precommit.sh. The hook runsmake check-abi-snapshotswhenever a staged file is underCOMEBACKHERE-contracts/contracts/orabis/, and the wrapper formats the failure message to point directly atmake update-abi-snapshots. The wrapper self-skips when theCOMEBACKHERE-contractssibling is not cloned locally, so unrelated commits are never blocked.Test plan
./scripts/check_error_docs_sync.shexits 0 on the current state after the docs extension; injecting an undeclared variant and re-running causes exit 1 (drift-injection test passed locally)..github/workflows/ci-error-docs.ymlparses cleanly and is gated oncontracts/**,COMEBACKHERE-contracts/**,docs/error-codes.md, and the script itself.markdownlint-cli2reports 0 issues onCONTRIBUTING.md,ARCHITECTURE.md, anddocs/error-codes.md..pre-commit-config.yamlparses cleanly; the new hook is registered alongside the existingabi-snapshot-hygiene,lint-docs, trailing-whitespace, end-of-file-fixer, and check-json hooks.Checklist
Notes
A prior review pass on the first cut of Commit 1 flagged a contradiction between the do-not-submit-to-mirrors wording and CONTRIBUTING.md/ARCHITECTURE.md and the fact that
docs/error-codes.mdcitescontracts/invoice/src/lib.rsas the source ofInvoiceError. Commit 1 has been rebuilt so the wording now acknowledges the mirrored trees still receive documentation-driven edits and are valid PR targets — they just have no independent CI workflow of their own.