Skip to content

feat(core): add compat.rs re-export layer for platform SDK types#19

Merged
echobt merged 6 commits intomainfrom
feat/core-compat-reexports
Feb 20, 2026
Merged

feat(core): add compat.rs re-export layer for platform SDK types#19
echobt merged 6 commits intomainfrom
feat/core-compat-reexports

Conversation

@echobt
Copy link

@echobt echobt commented Feb 20, 2026

Summary

Create a new term-core crate providing a compatibility/re-export layer that replaces local type definitions with canonical types from platform-core and platform-challenge-sdk.

Changes

  • New crate term-core (core/) with path dependencies on platform-core and platform-challenge-sdk
  • Re-exports from platform_core: Hotkey (replaces local [u8;32]), ChallengeId (UUID-based, replaces [u8;16]), Stake, Score, BlockHeight, ValidatorInfo, NetworkConfig, Job, JobStatus
  • Re-exports from platform_challenge_sdk: WeightAssignment (f64 weights), ChallengeRoute (HttpMethod enum), RouteRequest/RouteResponse (with params/query/auth_hotkey), ChallengeError, ServerChallenge trait, ChallengeContext, ChallengeMetadata, EvaluationResult, AgentInfo, weight calculation types, submission types, data types, P2P types, database
  • ChallengeConfigMeta: Thin wrapper combining ChallengeMetadata + ChallengeConfig fields with bidirectional conversion (handles dual ChallengeId type via inner UUID)
  • Deprecated backward-compatible types: LegacyChallengeId, LegacyWeightAssignment, LegacyRoute with Into conversions for incremental migration
  • Conversion utilities: weight_u16_to_f64/weight_f64_to_u16, challenge_id_from_bytes, method_str_to_enum/method_enum_to_str, normalize_weights, make_weight, make_route
  • Prelude submodule: Single-import access to all commonly needed types
  • 153 tests (126 unit + 27 doc tests) all passing
  • Updated workspace Cargo.toml to include core member

Create new term-core crate with src/core/compat.rs providing:
- Re-exports of Hotkey, ChallengeId (UUID-based) from platform_core
- Re-exports of WeightAssignment, ChallengeRoute (HttpMethod enum),
  RouteRequest, RouteResponse, ChallengeError, ServerChallenge from
  platform_challenge_sdk
- ChallengeConfigMeta thin wrapper combining metadata + config
- Deprecated backward-compatible aliases (LegacyChallengeId,
  LegacyWeightAssignment, LegacyRoute) with Into conversions
- Conversion utilities (weight_u16_to_f64, challenge_id_from_bytes,
  method_str_to_enum, normalize_weights, etc.)
- Prelude submodule for convenient imports
- 153 tests (126 unit + 27 doc tests)
@coderabbitai
Copy link

coderabbitai bot commented Feb 20, 2026

Warning

Rate limit exceeded

@echobt has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 21 minutes and 45 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/core-compat-reexports

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@echobt echobt merged commit 7cc93de into main Feb 20, 2026
6 checks passed
@echobt echobt deleted the feat/core-compat-reexports branch February 20, 2026 22:18
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