Skip to content

feat(sdk): add round-status predicates and human-readable label helper - #227

Open
Olasunkanmi975 wants to merge 2 commits into
Sub-Rosa-Issue:mainfrom
Olasunkanmi975:feat/sdk-round-status-predicates-192
Open

feat(sdk): add round-status predicates and human-readable label helper#227
Olasunkanmi975 wants to merge 2 commits into
Sub-Rosa-Issue:mainfrom
Olasunkanmi975:feat/sdk-round-status-predicates-192

Conversation

@Olasunkanmi975

Copy link
Copy Markdown

Summary

Implements issue #192: adds pure helpers in the SDK for reasoning about keeper
round statuses without depending on the keeper service.

  • classifyRoundStatus plus isActiveRoundStatus, isTerminalRoundStatus,
    isErrorRoundStatus predicates that partition every RoundStatus into
    exactly one bucket.
  • roundStatusLabel mapping each status to a human-readable string for
    dashboards, operator CLIs and alert copy.
  • View-level helpers isKeeperRoundActive, isKeeperRoundTerminal and
    isKeeperRoundSettlementPending operating on KeeperRoundStatusView.
  • Exported status vocab constants (ACTIVE_ROUND_STATUSES,
    TERMINAL_ROUND_STATUSES, ERROR_ROUND_STATUSES) kept in lockstep with
    services/keeper/src/status.ts.

Test plan

  • Added packages/sdk/src/round-status.test.ts covering classification
    partitioning, label generation and view helpers.
  • Updated public-api-snapshot.test.ts and the package test script.
  • pnpm test (103 passing) and pnpm typecheck are green.

closes #192

…d comparator

Previously a single malformed/non-numeric round entry in
.keeper-store.json caused listRounds() ordering (which did BigInt() on
the id) to throw, which the load path surfaced as a full corrupted-file
backup that dropped every entry.

- Drop individual malformed round entries on load instead of nuking the
  whole store (still warn, still back up on truly corrupted JSON).
- Extract a shared compareRoundIds() numeric comparator so listRounds
  and callers (parseRoundIdSpec) order rounds consistently regardless of
  id type.

Closes Sub-Rosa-Issue#194
@Olasunkanmi975

Copy link
Copy Markdown
Author

@karagozemin please review and kindly merge

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.

sdk: add round-status predicates and a human-readable label helper

1 participant