Skip to content

feat!: replace funty with platform-num, remove LinkType#17

Merged
konard merged 6 commits intomainfrom
issue-16-3373fe2814a2
Apr 14, 2026
Merged

feat!: replace funty with platform-num, remove LinkType#17
konard merged 6 commits intomainfrom
issue-16-3373fe2814a2

Conversation

@konard
Copy link
Copy Markdown
Member

@konard konard commented Apr 14, 2026

Summary

  • Replaced funty dependency with platform-num 0.8.0 (LinkReference trait)
  • Removed LinkType trait entirely — all bounds now use LinkReference directly
  • Removed num-traits dependencyplatform-num 0.8.0 re-exports WrappingAdd and LinkReference now includes WrappingArithmetic as a supertrait
  • Replaced all T::funty(n) calls with T::from_byte(n) across the codebase
  • Simplified all generic bounds from T: LinkReference + WrappingAdd to just T: LinkReference
  • Re-exported LinkReference from crate root for downstream convenience

Motivation

platform-data used funty::Unsigned while platform-trees used num_traits::Unsigned (via platform-num::Number). These are different traits from different crates, making it impossible to write T: data::LinkType + trees::LinkType without dual bounds. With LinkReference from platform-num 0.8.0, both crates now share the same base trait, enabling downstream crates like doublets-rs to use a single T: LinkReference bound.

Per review feedback, LinkType has been removed entirely. Per follow-up feedback, upgraded to platform-num 0.8.0 (after Numbers#147) to drop num-traits and simplify all bounds to just T: LinkReference.

Changes

File Change
Cargo.toml funty + num-traitsplatform-num 0.8.0
src/link_type.rs DeletedLinkType trait removed entirely
src/lib.rs Removed mod link_type and pub use LinkType; kept pub use LinkReference
src/hybrid.rs Uses LinkReference directly (no + WrappingAdd)
src/constants.rs Uses LinkReference directly (no + WrappingAdd)
src/converters.rs Uses LinkReference directly (no + WrappingAdd)
src/links.rs Uses LinkReference directly (no + WrappingAdd)
README.md Updated docs to reference LinkReference, removed num-traits from deps
changelog.d/ Updated breaking change fragment

Breaking changes

  • LinkType trait removed (replaced by LinkReference from platform-num)
  • FuntyPart trait removed (replaced by LinkReference::from_byte)
  • T::funty(n)T::from_byte(n) migration required for downstream users
  • All generic bounds changed from T: LinkType to T: LinkReference
  • num-traits no longer a direct dependency

Test plan

  • cargo build compiles cleanly
  • cargo clippy --all-targets passes with zero warnings
  • cargo test --all-features passes (all 94 tests + 1 doctest)
  • CI pipeline passes on GitHub Actions

Closes #16

🤖 Generated with Claude Code

Adding .gitkeep for PR creation (default mode).
This file will be removed when the task is complete.

Issue: #16
@konard konard self-assigned this Apr 14, 2026
Replace `funty::Unsigned` and `FuntyPart` in the `LinkType` trait with
`LinkReference` from `platform-num`, eliminating the `funty` dependency.

- `LinkType` now extends `LinkReference + WrappingAdd`
- All `T::funty(n)` calls replaced with `T::from_byte(n)`
- Re-export `LinkReference` from crate root for downstream use
- Added `num-traits` dependency for `WrappingAdd` bound

This unifies the trait hierarchy with `platform-trees` so downstream
crates like `doublets-rs` can use a single `T: LinkReference` bound.

Closes #16

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@konard konard changed the title [WIP] Replace funty dependency with platform-num (Numbers) for LinkType trait feat!: replace funty with platform-num LinkReference Apr 14, 2026
@konard konard marked this pull request as ready for review April 14, 2026 11:42
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@konard
Copy link
Copy Markdown
Member Author

konard commented Apr 14, 2026

🤖 Solution Draft Log

This log file contains the complete execution trace of the AI solution draft process.

💰 Cost estimation:

  • Public pricing estimate: $2.837700
  • Calculated by Anthropic: $2.837701
  • Difference: $0.000000 (+0.00%)

📊 Context and tokens usage:

  • Context window: 77.8K / 1M (8%) input tokens, 13.8K / 128K (11%) output tokens

Total: (68.8K + 4.1M cached) input tokens, 13.8K output tokens, $2.837700 cost

🤖 Models used:

  • Tool: Anthropic Claude Code
  • Requested: opus
  • Model: Claude Opus 4.6 (claude-opus-4-6)

📎 Log file uploaded as Gist (1874KB)


Now working session is ended, feel free to review and add any feedback on the solution draft.

@konard
Copy link
Copy Markdown
Member Author

konard commented Apr 14, 2026

✅ Ready to merge

This pull request is now ready to be merged:

  • All CI checks have passed
  • No merge conflicts
  • No pending changes

Monitored by hive-mind with --auto-restart-until-mergeable flag

@konard
Copy link
Copy Markdown
Member Author

konard commented Apr 14, 2026

We must remove all mentions of LinkType must breakchange it to LinkReference. Only LinkReference should stay, if some features are missing in Numbers required to do so report issue there. So no LinkType will longer exist, and doublet-rs will use only LinkReference.

@konard konard marked this pull request as draft April 14, 2026 12:03
@konard
Copy link
Copy Markdown
Member Author

konard commented Apr 14, 2026

🤖 AI Work Session Started

Starting automated work session at 2026-04-14T12:03:23.369Z

The PR has been converted to draft mode while work is in progress.

This comment marks the beginning of an AI work session. Please wait for the session to finish, and provide your feedback.

LinkType was a thin wrapper around LinkReference + WrappingAdd.
Remove it entirely per review feedback — downstream crates like
doublets-rs should use LinkReference directly. WrappingAdd is
still needed from num-traits where wrapping arithmetic is used
(hybrid.rs, constants.rs, converters.rs, links.rs) until
platform-num adds it to LinkReference.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@konard konard changed the title feat!: replace funty with platform-num LinkReference feat!: replace funty with platform-num, remove LinkType Apr 14, 2026
@konard konard marked this pull request as ready for review April 14, 2026 12:13
@konard
Copy link
Copy Markdown
Member Author

konard commented Apr 14, 2026

🤖 Solution Draft Log

This log file contains the complete execution trace of the AI solution draft process.

💰 Cost: $1.787033

📊 Context and tokens usage:

Claude Opus 4.6:

  • Context window: 66.8K / 1M (7%) input tokens, 12.5K / 128K (10%) output tokens

Total: (57.3K + 2.2M cached) input tokens, 12.5K output tokens, $1.746119 cost

Claude Haiku 4.5:

Total: (15.0K + 112.1K cached) input tokens, 2.2K / 64K (3%) output tokens, $0.040914 cost

🤖 Models used:

  • Tool: Anthropic Claude Code
  • Requested: opus
  • Main model: Claude Opus 4.6 (claude-opus-4-6)
  • Additional models:
    • Claude Haiku 4.5 (claude-haiku-4-5-20251001)

📎 Log file uploaded as Gist (1565KB)


Now working session is ended, feel free to review and add any feedback on the solution draft.

@konard
Copy link
Copy Markdown
Member Author

konard commented Apr 14, 2026

✅ Ready to merge

This pull request is now ready to be merged:

  • All CI checks have passed
  • No merge conflicts
  • No pending changes

Monitored by hive-mind with --auto-restart-until-mergeable flag

@konard
Copy link
Copy Markdown
Member Author

konard commented Apr 14, 2026

After linksplatform/Numbers#147 is applied use latest version of https://crates.io/crates/platform-num, now we can fully support LinkReference, and also fully drop num_traits dependency, as https://crates.io/crates/platform-num reexports everything.

If something is still missing - report bug at https://github.com/linksplatform/Numbers

@konard konard marked this pull request as draft April 14, 2026 13:00
@konard
Copy link
Copy Markdown
Member Author

konard commented Apr 14, 2026

🤖 AI Work Session Started

Starting automated work session at 2026-04-14T13:00:35.308Z

The PR has been converted to draft mode while work is in progress.

This comment marks the beginning of an AI work session. Please wait for the session to finish, and provide your feedback.

LinkReference in platform-num 0.8.0 includes WrappingArithmetic as a
supertrait, so explicit + WrappingAdd bounds and the num-traits
dependency are no longer needed.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@konard konard marked this pull request as ready for review April 14, 2026 13:06
@konard
Copy link
Copy Markdown
Member Author

konard commented Apr 14, 2026

🤖 Solution Draft Log

This log file contains the complete execution trace of the AI solution draft process.

💰 Cost: $1.101457

📊 Context and tokens usage:

  • Context window: 49.8K / 1M (5%) input tokens, 8.2K / 128K (6%) output tokens

Total: (38.2K + 1.3M cached) input tokens, 8.2K output tokens, $1.101457 cost

🤖 Models used:

  • Tool: Anthropic Claude Code
  • Requested: opus
  • Model: Claude Opus 4.6 (claude-opus-4-6)

📎 Log file uploaded as Gist (1031KB)


Now working session is ended, feel free to review and add any feedback on the solution draft.

@konard
Copy link
Copy Markdown
Member Author

konard commented Apr 14, 2026

✅ Ready to merge

This pull request is now ready to be merged:

  • All CI checks have passed
  • No merge conflicts
  • No pending changes

Monitored by hive-mind with --auto-restart-until-mergeable flag

@konard konard merged commit 3725de0 into main Apr 14, 2026
13 checks passed
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.

Replace funty dependency with platform-num (Numbers) for LinkType trait

1 participant