Skip to content

feat: support full string ids#53

Merged
konard merged 7 commits intomainfrom
issue-11-36571c97
Apr 30, 2026
Merged

feat: support full string ids#53
konard merged 7 commits intomainfrom
issue-11-36571c97

Conversation

@konard
Copy link
Copy Markdown
Member

@konard konard commented Sep 10, 2025

Summary

Fixes #11.

This PR adds full string ID alias support for advanced LiNo queries in both C# and Rust, and updates the branch to the latest main history. The C# CLI now constructs NamedTypesDecorator<uint>, while the Rust CLI now constructs NamedTypesDecorator so aliases are resolved from the separate names database instead of being stored inline with primary links.

Implementation

  • Resolve string aliases anywhere link IDs are parsed, including restriction matching and substitution conversion.
  • Add INamedTypesLinks<TLinkAddress> on the C# side so advanced query processing and LiNo output work against links that also expose name lookup APIs.
  • Add NamedTypeLinks on the Rust side so query processing, reference validation, LiNo output, and CLI operations can run against NamedTypesDecorator.
  • Keep named link decorators compatible with the shared interfaces while routing CLI and advanced query tests through named-type-aware storage.
  • Add release metadata for the C# and Rust package flows.

Reproduction

Before this fix, named IDs inside variable restrictions could behave like unconstrained wildcards during matching. The regression tests create named links and update only links matching father -> mother:

((($id: father mother)) (($id: mother father)))

The tests verify father and mother remain self-referential and only child changes to mother -> father.

Rust also has a CLI regression test that runs:

clink --db /tmp/string-ids.links --auto-create-missing-references '() ((child: father mother))' --after

and verifies father, mother, and child are printed as aliases while the primary .links file contains no alias text; the aliases are stored in the generated .names.links database.

Verification

  • dotnet test csharp/Foundation.Data.Doublets.Cli.sln
  • dotnet restore from csharp/
  • dotnet build --no-restore --configuration Release from csharp/
  • dotnet test --no-build --configuration Release --verbosity normal from csharp/
  • cargo fmt --all -- --check from rust/
  • RUSTFLAGS=-Dwarnings cargo clippy --all-targets --all-features from rust/
  • cargo test --all-features --verbose from rust/
  • cargo test --doc --verbose from rust/
  • cargo build --release --verbose from rust/
  • node scripts/check-file-size.mjs --lang rust
  • CI passed for latest head 9f7076f on 2026-04-30.
  • Manual C# CLI check:
dotnet run --project csharp/Foundation.Data.Doublets.Cli --configuration Release -- --db /tmp/string-ids/db.links --auto-create-missing-references '() ((person: name john))' --after

Output:

(john: john john)
(name: name name)
(person: name john)

Adding CLAUDE.md with task information for AI processing.
This file will be removed when the task is complete.

Issue: #11
@konard konard self-assigned this Sep 10, 2025
konard and others added 2 commits September 10, 2025 17:37
- Enhanced TryParseLinkId to support string aliases alongside numeric IDs
- Added overloaded version that uses NamedLinksDecorator for alias resolution
- Updated all parser calls to use new string-aware ID parsing
- String IDs are automatically mapped to numeric IDs when creating new links
- Output formatting already converts numeric IDs back to string aliases
- All 124 existing tests pass, confirming backward compatibility

This implements the key-value store functionality requested in issue #11,
where string aliases serve as keys that map to link IDs.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@konard konard changed the title [WIP] Support full string ids Support full string ids Sep 10, 2025
@konard konard marked this pull request as ready for review September 10, 2025 14:46
@konard
Copy link
Copy Markdown
Member Author

konard commented Apr 30, 2026

We need to get latest changes from default branch.

Now we need to make sure our codebase uses newly added NamedTypes decorator that uses PinnedTypes decorator inside it. So we should simplify our code, make it shorter and make sure it helps for code deduplication, easy configuration and reuse.

We need to ensure all changes are correct, consistent, validated, tested, logged and fully meet each and all discussed requirements in widest possible sense (check issue description and all comments in issue and in pull request, make sure each and every requirement listed before actually checking if they were addressed). Ensure all CI/CD checks pass.

Please plan and execute everything in a single pull request, you have unlimited time and context, as context autocompacts and you can continue indefinetely, do as much as possible in one go, until it is each and every requirement fully addressed, and everything is totally done.

@konard konard marked this pull request as draft April 30, 2026 08:27
@konard
Copy link
Copy Markdown
Member Author

konard commented Apr 30, 2026

🤖 AI Work Session Started

Starting automated work session at 2026-04-30T08:27:36.474Z

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.

@konard konard changed the title Support full string ids feat: support full string ids Apr 30, 2026
@konard konard marked this pull request as ready for review April 30, 2026 08:38
@konard
Copy link
Copy Markdown
Member Author

konard commented Apr 30, 2026

Solution summary

Implemented and pushed the fix to PR 53: #53

What changed:

  • Merged latest origin/main; PR merge status is now CLEAN.
  • Switched the string-id support to use the new NamedTypesDecorator.
  • Added a reusable INamedTypesLinks<T> interface to simplify consumers that need both link operations and name lookup.
  • Updated CLI/query/output paths to resolve string aliases consistently.
  • Added a regression test for $id: variable restrictions using named string ids.
  • Updated the PR title/body and marked it ready for review.

Verification:


This summary was automatically extracted from the AI working session output.

@konard
Copy link
Copy Markdown
Member Author

konard commented Apr 30, 2026

🤖 Solution Draft Log

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

💰 Cost estimation:

  • Model: GPT-5.5
  • Provider: OpenAI
  • Public pricing estimate: $7.929695

📊 Context and tokens usage:

  • 5.6M / 1.1M (530%) input tokens, 21.2K / 128K (17%) output tokens

Total: (156.7K + 5.4M cached) input tokens, 21.2K output tokens, $7.929695 cost

🤖 Models used:

  • Tool: OpenAI Codex
  • Requested: gpt-5.5
  • Model: GPT-5.5 (gpt-5.5)

📎 Log file uploaded as Gist (21606KB)


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 30, 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 30, 2026

Double check for all the same for Rust, all Rust code should be in sync with C# code.

We need to ensure all changes are correct, consistent, validated, tested, logged and fully meet each and all discussed requirements in widest possible sense (check issue description and all comments in issue and in pull request, make sure each and every requirement listed before actually checking if they were addressed). Ensure all CI/CD checks pass.

Please plan and execute everything in a single pull request, you have unlimited time and context, as context autocompacts and you can continue indefinetely, do as much as possible in one go, until it is each and every requirement fully addressed, and everything is totally done.

@konard konard marked this pull request as draft April 30, 2026 10:22
@konard
Copy link
Copy Markdown
Member Author

konard commented Apr 30, 2026

🤖 AI Work Session Started

Starting automated work session at 2026-04-30T10:22:18.178Z

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.

@konard konard marked this pull request as ready for review April 30, 2026 10:38
@konard
Copy link
Copy Markdown
Member Author

konard commented Apr 30, 2026

Working session summary

Implemented and pushed the Rust sync for full string ID aliases, keeping it aligned with the C# named-types design.

PR: #53

What changed:

  • Added Rust NamedTypeLinks abstraction and wired CLI/query processing through NamedTypesDecorator.
  • Added Rust coverage for named string aliases in query processing and CLI storage.
  • Split Rust query helper types into a separate file after CI caught the 1000-line file-size gate.
  • Updated the PR title/body and marked PR feat: support full string ids #53 ready for review.

Verification:

  • Local Rust checks passed: fmt, clippy, full tests, doc tests, release build, file-size check.
  • Local C# tests passed: dotnet test csharp/Foundation.Data.Doublets.Cli.sln.
  • Latest CI on head 9f7076f7b3284ad4f2074cd5817e60fa398bfa56 passed:
    • Rust CI/CD Pipeline: 25160990828
    • C# CI/CD Pipeline: 25160990818

Working tree is clean.


This summary was automatically extracted from the AI working session output.

@konard
Copy link
Copy Markdown
Member Author

konard commented Apr 30, 2026

🤖 Solution Draft Log

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

💰 Cost estimation:

  • Model: GPT-5.5
  • Provider: OpenAI
  • Public pricing estimate: $17.548926

📊 Context and tokens usage:

  • peak request: 12.1M / 1.1M (1153%) input tokens, 41.0K / 128K (32%) output tokens

Total: (399.5K + 11.7M cached) input tokens, 41.0K output tokens, $17.548926 cost

🤖 Models used:

  • Tool: OpenAI Codex
  • Requested: gpt-5.5
  • Model: GPT-5.5 (gpt-5.5)

📎 Log file uploaded as Repository (64069KB)


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 30, 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 cc307cb into main Apr 30, 2026
18 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.

Support full string ids

1 participant