Skip to content

refactor: foundation cleanup - rename, edition fixes, constants, coverage CI#102

Open
flyq wants to merge 3 commits intomainfrom
liquan/refactor1
Open

refactor: foundation cleanup - rename, edition fixes, constants, coverage CI#102
flyq wants to merge 3 commits intomainfrom
liquan/refactor1

Conversation

@flyq
Copy link
Member

@flyq flyq commented Mar 23, 2026

Summary

Foundation cleanup that renames the core crate, fixes workspace consistency issues, deduplicates constants, and adds coverage CI infrastructure.

Changes

  • Rename validator-corestateless-core: renamed the crate directory, updated Cargo.toml, all use validator_core:: references across the workspace, docs (README.md, AGENTS.md), CODEOWNERS, and logging filter directives.
  • Fix debug-trace-server workspace fields: set edition.workspace = true and version.workspace = true (was hardcoded to 2021 / 0.1.0).
  • Deduplicate constants: move DEFAULT_METRICS_PORT to stateless-common and re-export from both binaries; remove duplicate SLOW_STAGE_THRESHOLD_MS declaration (was in both data_provider.rs and rpc_service.rs).
  • Add coverage CI: add scripts/coverage_stateless_core.sh and .github/workflows/coverage.yml for coverage reporting via cargo-llvm-cov + Codecov (following mega-evm pattern), plus .github/codecov.yml config targeting the stateless-core package.

Files changed

38 files changed across the workspace (283 insertions, 152 deletions), including the full directory rename from crates/validator-core/ to crates/stateless-core/.

…rage CI

- Rename `validator-core` crate to `stateless-core` (directory, Cargo.toml,
  all `use validator_core::` references across workspace, docs, CODEOWNERS,
  and logging filter directives)
- Fix `debug-trace-server`: set `edition.workspace = true` and
  `version.workspace = true` (was 2021 / 0.1.0)
- Move `DEFAULT_METRICS_PORT` to `stateless-common` and re-export from both
  binaries; deduplicate `SLOW_STAGE_THRESHOLD_MS` in `debug-trace-server`
  (was declared in both `data_provider.rs` and `rpc_service.rs`)
- Add `scripts/coverage_stateless_core.sh` and
  `.github/workflows/coverage.yml` for coverage reporting via
  `cargo-llvm-cov` + Codecov (following mega-evm pattern)
- Add `.github/codecov.yml` config targeting `stateless-core` package
@flyq flyq requested review from Troublor and krabat-l as code owners March 23, 2026 15:05
@@ -46,7 +50,7 @@ tracing.workspace = true

# Reuse validator-core
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale comment — should be updated to match the renamed crate.

Suggested change
# Reuse validator-core
# stateless-core

@claude
Copy link

claude bot commented Mar 24, 2026

The rename is complete and consistent across all 38 files — Cargo manifests, imports, docs, CODEOWNERS, logging filters, and the lock file. Workspace field inheritance for debug-trace-server and constant deduplication (DEFAULT_METRICS_PORT, SLOW_STAGE_THRESHOLD_MS) are done cleanly.

Coverage CI looks standard: --locked, proper artifact upload, Codecov path fix is the expected pattern for the GitHub Actions runner path.

One stale comment flagged inline. Nothing else to address.

@flyq flyq force-pushed the liquan/refactor1 branch from 5472502 to 6cdb09e Compare March 24, 2026 02:02
@claude
Copy link

claude bot commented Mar 24, 2026

Clean, mechanical rename — the codebase changes are consistent and complete. One minor issue flagged inline.

Coverage CI

  • fail_ci_if_error: false on the Codecov upload step means a missing/expired CODECOV_TOKEN secret will fail silently. Consider flipping this to true once the token is confirmed to be configured, so breakage is visible.
  • The fixes path in codecov.yml is correct for the GitHub Actions runner environment and follows the established pattern.

Everything else (constant deduplication, workspace field alignment, let-chain refactoring in tests) looks good.

@claude
Copy link

claude bot commented Mar 24, 2026

The rename is clean and complete — all references updated consistently across workspace, docs, CODEOWNERS, and logging directives. Workspace field fixes and constant deduplication are good. Two minor issues in the coverage setup worth addressing.

cargo llvm-cov \
--locked \
--package stateless-core \
--all-features \
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

--all-features activates test-bucket-resize, which changes SALT bucket sizing. Coverage numbers will reflect a non-default build configuration, potentially inflating or deflating coverage for production code paths. Consider dropping --all-features and only opting in to features that don't alter runtime behavior.

components: llvm-tools-preview

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

stateless-core unit tests don't use forge or anvil — Foundry is only needed by the debug-trace-server integration tests. This step adds unnecessary CI time and can be dropped.

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