Skip to content

feat(lib): add validator-side library crate with SDK type imports#18

Merged
echobt merged 9 commits intomainfrom
feat/lib-validator-sdk-types
Feb 20, 2026
Merged

feat(lib): add validator-side library crate with SDK type imports#18
echobt merged 9 commits intomainfrom
feat/lib-validator-sdk-types

Conversation

@echobt
Copy link

@echobt echobt commented Feb 20, 2026

Summary

Add a new native library crate lib/ (term-challenge-lib) to the workspace, providing validator-side challenge logic that imports SDK types from platform-v2.

Changes

  • lib/Cargo.toml: New crate with dependencies on platform-core (for Hotkey) and platform-challenge-sdk (for ChallengeId)
  • lib/src/lib.rs: Module declarations for dataset, synthetic, validation, admin, util, cache, chain, worker; glob re-exports dataset::*; re-exports ChallengeId and Hotkey
  • lib/src/dataset.rs: DatasetEntry type using ChallengeId
  • lib/src/synthetic/mod.rs: SyntheticTask type using ChallengeId and Hotkey
  • lib/src/validation/mod.rs: ValidationResult type using ChallengeId and Hotkey
  • lib/src/admin/mod.rs: AdminAction type using ChallengeId and Hotkey
  • lib/src/util/hotkey.rs: parse_hotkey helper wrapping platform_core::Hotkey::from_ss58
  • lib/src/cache/mod.rs: ScoreCache keyed by (ChallengeId, Hotkey)
  • lib/src/chain/mod.rs: ChainSubmission type using ChallengeId and Hotkey
  • lib/src/worker/mod.rs: WorkerJob and WorkerJobStatus types using ChallengeId and Hotkey
  • lib/src/bin/term-sudo.rs: Admin CLI binary consuming ChallengeId and Hotkey
  • Cargo.toml: Added lib to workspace members, added w3f-bls patch
  • AGENTS.md: Updated architecture docs with lib crate structure

Add new term-challenge-lib crate (lib/) to the workspace providing
validator-side challenge logic using platform-v2 SDK types.

New modules created:
- dataset: DatasetEntry type using ChallengeId, re-exported from lib root
- synthetic: SyntheticTask type using ChallengeId and Hotkey
- validation: ValidationResult type using ChallengeId and Hotkey
- admin: AdminAction type using ChallengeId and Hotkey
- util/hotkey: parse_hotkey helper wrapping platform_core::Hotkey
- cache: ScoreCache keyed by (ChallengeId, Hotkey)
- chain: ChainSubmission type using ChallengeId and Hotkey
- worker: WorkerJob and WorkerJobStatus using ChallengeId and Hotkey
- bin/term-sudo: Admin CLI binary consuming ChallengeId and Hotkey

lib.rs declares all modules, glob re-exports dataset::*, and
re-exports ChallengeId from platform_challenge_sdk and Hotkey
from platform_core.

Workspace Cargo.toml updated to include lib/ as a member and adds
the w3f-bls patch required by platform-core transitive deps.
AGENTS.md updated with lib crate architecture documentation.
@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 13 minutes and 8 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/lib-validator-sdk-types

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.

…k-types

# Conflicts:
#	AGENTS.md
#	Cargo.lock
#	Cargo.toml
…b/storage

- Change workspace deps from platform.git to platform-v2.git which exports
  ChallengeContext, routes(), and handle_route() on the ServerChallenge trait
- Switch server/Cargo.toml from local path dep to workspace = true
- Switch lib/Cargo.toml and storage/Cargo.toml to workspace = true
- Regenerate Cargo.lock
- Add 'core' and 'lib' to workspace members
- Use platform-v2 branch=main for workspace SDK deps
- Switch server/Cargo.toml to workspace = true
- Regenerate Cargo.lock
@echobt echobt merged commit 7b22437 into main Feb 20, 2026
6 checks passed
@echobt echobt deleted the feat/lib-validator-sdk-types branch February 20, 2026 22:27
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