Skip to content

feat: add scorer-kit#20

Draft
ovitrif wants to merge 1 commit into
synonymdev:mainfrom
ovitrif:codex/scorer-kit
Draft

feat: add scorer-kit#20
ovitrif wants to merge 1 commit into
synonymdev:mainfrom
ovitrif:codex/scorer-kit

Conversation

@ovitrif
Copy link
Copy Markdown

@ovitrif ovitrif commented May 16, 2026

Context

This PR moves the offline scorer-file tooling previously introduced via synonymdev/ldk-node#79 into the scorer repo as scorer-kit and enhances its functionality with merging and decoding capabilities.

The tool is intended for local/operator workflows around serialized LDK ChannelLiquidities files: inspect them, decode them to JSON, compare two snapshots, validate bytes, and merge multiple scorer files into a new scorer binary.

The scorer-kit binary uses the scorer merge/diagnostics API exposed in synonymdev/rust-lightning#2 via an aliased dependency pinned to the commit in the branch of that branch, so the existing scorer node/prober dependency graph remains on its current LDK crate set.

What Changed

  • Adds src/bin/scorer-kit.rs with subcommands:
    • inspect
    • decode
    • compare
    • merge
    • validate
  • Adds policy-driven duplicate handling for merge:
    • default: richer-history
    • optional: prefer-first, prefer-last, combine, newer
  • Adds merge audit reports with duplicate decisions and summary counts.
  • Adds sanitized decoded JSON fixtures under test_data/scorer-kit/.
  • Documents common scorer-kit flows in the README.

Current Sample Result

Using the current two source samples, scorer-kit merge produced a 16,609-entry merged scorer file. The audit report recorded 1,184 duplicate short-channel-id decisions: 389 kept from the existing input, 795 replaced by the incoming input, and 0 blindly combined under the default richer-history policy.

Notes

The default merge policy avoids blindly combining duplicate short-channel-id entries. Unique entries are preserved, and overlaps choose the entry with stronger historical signal unless another policy is explicitly requested.

Test Plan

  • cargo check --bin scorer-kit
  • cargo check
  • cargo test
  • scorer-kit validate <source-a.bin> <source-b.bin>
  • scorer-kit inspect <source-a.bin> --label source-a --top 5
  • scorer-kit inspect <source-b.bin> --label source-b --top 5
  • scorer-kit compare <source-a.bin> <source-b.bin> --left-label source-a --right-label source-b
  • scorer-kit compare <source-a.bin> <source-b.bin> --left-label source-a --right-label source-b --output csv
  • scorer-kit merge <source-b.bin> <source-a.bin> --label source-b --label source-a --output target/scorer-kit/merged.bin --report target/scorer-kit/merge-report.json --policy richer-history
  • scorer-kit validate target/scorer-kit/merged.bin
  • sensitive term scan over staged files and PR body

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