Skip to content

chore: contract-stack docs, error-doc CI, CODEOWNERS, and pre-commit ABI guard - #290

Merged
levoski1 merged 4 commits into
WHEELBACK:mainfrom
Emmy6654:chore/contract-stack-tooling-and-governance
Jul 26, 2026
Merged

chore: contract-stack docs, error-doc CI, CODEOWNERS, and pre-commit ABI guard#290
levoski1 merged 4 commits into
WHEELBACK:mainfrom
Emmy6654:chore/contract-stack-tooling-and-governance

Conversation

@Emmy6654

@Emmy6654 Emmy6654 commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

Closes #281
Closes #282
Closes #283
Closes #284

Summary

Four small, orthogonal improvements across docs, error-code tooling, ownership, and pre-commit safety:

  1. docs: document which app tree to contribute tocloses docs/feat: treasury hold docs, backend env validation, address schema check, mainnet dry-run #285
    Adds 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-level contracts/, 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.

  2. chore: add ci check for error code documentation driftcloses feat(wallet): fully clear session state and state-gated views on disconnect #286
    Adds scripts/check_error_docs_sync.sh plus a new .github/workflows/ci-error-docs.yml. The script walks every *Error enum in contracts/ and COMEBACKHERE-contracts/, extracts variants with awk/grep (no Rust AST parser), and fails on any variant name with no matching row in any table of docs/error-codes.md. A .check-error-codes-ignore file allows intentional enum:Name or var:Name skips. Also extends the docs file with the three missing sections (TreasuryError; ContractError (invoice); ContractError (compliance)) so the check passes on the current clean state.

  3. chore: add codeowners rules for contract directoriescloses addmotion #287
    Adds 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 contracts/, scripts/, docs/ rules are unchanged.

  4. chore: add pre commit hook for abi snapshot checkcloses fix: fix silent failure in abi snapshot hygiene check #288
    Adds a new pre-commit hook (id: check-abi-snapshots) wired to a small wrapper script scripts/check_abi_snapshots_precommit.sh. The hook runs make check-abi-snapshots whenever a staged file is under COMEBACKHERE-contracts/contracts/ or abis/, and the wrapper formats the failure message to point directly at make update-abi-snapshots. The wrapper self-skips when the COMEBACKHERE-contracts sibling is not cloned locally, so unrelated commits are never blocked.

Test plan

  • ./scripts/check_error_docs_sync.sh exits 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.yml parses cleanly and is gated on contracts/**, COMEBACKHERE-contracts/**, docs/error-codes.md, and the script itself.
  • markdownlint-cli2 reports 0 issues on CONTRIBUTING.md, ARCHITECTURE.md, and docs/error-codes.md.
  • .pre-commit-config.yaml parses cleanly; the new hook is registered alongside the existing abi-snapshot-hygiene, lint-docs, trailing-whitespace, end-of-file-fixer, and check-json hooks.
  • The two new wrapper scripts are committed executable.

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.md cites contracts/invoice/src/lib.rs as the source of InvoiceError. 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.

Emmy6654 added 4 commits July 25, 2026 13:56
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
Emmy6654 force-pushed the chore/contract-stack-tooling-and-governance branch from 36499ce to 3623d25 Compare July 25, 2026 13:59
@drips-wave

drips-wave Bot commented Jul 25, 2026

Copy link
Copy Markdown

@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! 🚀

Learn more about application limits

@levoski1
levoski1 merged commit 40730e9 into WHEELBACK:main Jul 26, 2026
1 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment