Skip to content

feat(miner-foundation): extract duplicate-winner adjudication into gittensory-engine #2278

Description

@JSONbored

Move the pure, IO-free src/signals/duplicate-winner.ts (60 lines) into packages/gittensory-engine/src/duplicate-winner.ts. This module's election logic ("exactly one winner survives a duplicate cluster: the earliest observed linked-issue claimant") is explicitly called out in the roadmap as reusable for the miner's own soft-claim adjudication (deciding which of several miners claiming the same issue proceeds) — extracting it now means both the maintainer gate and the miner's local claim-ledger (a later Phase-0 issue) import the identical, versioned logic instead of the miner reimplementing its own copy that could drift.

Deliverables

  • packages/gittensory-engine/src/duplicate-winner.ts — verbatim port of DuplicateClaimMember, isDuplicateClusterWinnerByClaim, and the deprecated isDuplicateClusterWinner (keep the @deprecated doc comment; do not drop legacy callers' compatibility).
  • src/signals/duplicate-winner.ts becomes a thin re-export shim from @jsonbored/gittensory-engine so existing src/ imports keep working unchanged.
  • Existing duplicate-winner test suite passes unmodified against the shim.
  • packages/gittensory-engine/src/index.ts re-exports the new module.
  • A doc comment on the engine copy notes the intended second consumer (the miner's local claim ledger) so a future contributor wiring that ledger knows this module already exists and should be reused, not reimplemented.

References

  • src/signals/duplicate-winner.ts (60 lines, full file) — the exact module to port, PURE (no IO, no Date, no random per its own header comment).
  • packages/gittensory-engine/ — created by the package-skeleton issue (must land first).
  • Phase description's explicit call-out: "has the duplicate-winner ELECTION logic — reuse for soft-claim adjudication".

Metadata

Metadata

Assignees

No one assigned

    Labels

    gittensor:featureGittensor-scored feature linked to a feature issue — scores a 0.25x multiplier.help wantedExtra attention is needed

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions