Skip to content

fix: coverage report + gas snapshot + CI + env example#18

Merged
garykocsis merged 2 commits into
mainfrom
fix/coverage-gas
Jun 10, 2026
Merged

fix: coverage report + gas snapshot + CI + env example#18
garykocsis merged 2 commits into
mainfrom
fix/coverage-gas

Conversation

@garykocsis

Copy link
Copy Markdown
Owner

Summary

Session 16 complete. Coverage report, gas snapshot, CI updates, and environment setup.

What shipped

  • .gas-snapshot — 277 deterministic test baselines committed
  • docs/coverage-summary.md — full coverage report with production contract breakdown
  • .env.example — complete environment variable template with comments
  • .github/workflows/ci.yml — added gas snapshot + coverage jobs
  • README.md — 5 static badges added

Coverage Results

  • Total: 98.45% lines · 98.51% statements · 92.86% branches · 94.23% functions
  • RangeGuardHook.sol: 100% lines | 100% functions
  • RangeGuardReactive.sol: 100% lines | 100% functions
  • Aggregate held below 100% only by MockUSDC.sol (testnet mock, intentional) and vendored ReactVM-detection branches (untestable in Foundry)

Gas Efficiency (production functions)

Function Avg Gas
afterSwap eckpoint
afterRemoveLiquidity 61,922
afterAddLiquidity 163,872
beforeInitialize 212,967

afterSwap at 46,414 gas — constant cost, no LP iteration, O(1) by design.

CI Changes

  • Gas snapshot job: forge snapshot --check on every PR — fails if gas increases
  • Coverage job: forge coverage --report summary on every PR
  • Both exclude Sepolia fork tests (non-deterministic, fork-block-dependent)

Next

Full README — final session

Session 16. Add committed .gas-snapshot baseline, coverage summary, CI
gas-regression + coverage jobs, README badges, and .env.example.

- docs/coverage-summary.md: 98.45% lines total; RangeGuardHook.sol +
  RangeGuardReactive.sol at 100% lines/functions. Production Contract
  Coverage section explains MockUSDC (testnet mock) + AbstractPausableReactive
  ReactVM branches as the only sub-100% items.
- .gas-snapshot: deterministic baseline (278 tests; 14 Sepolia fork tests
  excluded — they vm.skip without SEPOLIA_RPC_URL and are fork-block-dependent).
- ci.yml: gas-snapshot (forge snapshot --check) + coverage jobs, pinned
  Foundry 1.3.5 + recursive submodules.
- README: tests/coverage/license/network/reactive badges.
- .env.example: template with live deployed addresses; .env gitignored.
- coverage/ + lcov.info gitignored.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@vercel

vercel Bot commented Jun 10, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
range-guard Ready Ready Preview, Comment Jun 10, 2026 1:48am

The first CI run of the gas-snapshot job failed: four fuzz tests drifted
1-657 gas vs the committed baseline (mean gas over random inputs is not
byte-reproducible across environments, even with the pinned seed=0x1 —
corpus cache + platform). All 278 tests passed functionally; it was pure
snapshot noise on fuzz/invariant means.

Fix: gate DETERMINISTIC tests only. Regenerate .gas-snapshot and the CI
--check with --no-match-test "(testFuzz|invariant)" (alongside the existing
Sepolia fork --no-match-path). Baseline 277 -> 204 entries; concrete unit +
integration tests still exercise every production function with fixed inputs,
so real regressions are still caught.

- Makefile: snapshot target carries the deterministic filters; new gas-check
  target mirrors the CI gate locally (run before pushing).
- Docs (session-16, project-status, CLAUDE.md): exclusion rationale + the
  note that --no-verify was not the cause (pre-push runs test, not snapshot).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@garykocsis garykocsis merged commit 3543ec4 into main Jun 10, 2026
5 checks passed
@garykocsis garykocsis deleted the fix/coverage-gas branch June 10, 2026 02:00
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