Skip to content

Conversation

@konard
Copy link
Member

@konard konard commented Sep 14, 2025

Summary

This PR resolves the semantic ambiguity in the ILinks interface where null restrictions could be interpreted as either "any link" or "no link", as reported in issue #37.

Changes Made

Documentation Clarifications:

  • Count: Clarified that null restriction returns 0 (no links match empty restriction)
  • Each: Specified that null restriction processes no links (safe behavior)
  • Create: Defined that null substitution creates a point (self-referencing link)
  • Update: Established that null restriction updates no links (safer default)
  • Delete: Added explicit safety warnings that null restriction deletes NO links

Key Safety Improvements:

  • Replaced ambiguous "no restriction" language with explicit null behavior semantics
  • Distinguished between null (safe, matches nothing) and Constants.Any (matches everything)
  • Added critical safety warnings for Delete operations to prevent accidental data loss
  • Ensured consistent behavioral interpretation across all CRUD operations
  • Updated Russian translations to match the new semantic definitions

Rationale

The previous ambiguity was dangerous, especially for Delete operations where null could potentially be interpreted as "delete all links". This PR establishes the safer interpretation where null means "match nothing" as the standard behavior.

To explicitly match all links, developers must use Constants.Any in restriction arrays, making the intent clear and preventing accidental destructive operations.

Test Results

All existing tests pass, confirming backward compatibility with current implementations.

Test plan

  • Verify all existing tests continue to pass
  • Confirm documentation clearly distinguishes null vs Constants.Any behavior
  • Ensure safety warnings are prominently displayed for destructive operations
  • Validate Russian translations maintain semantic consistency

Fixes #37

🤖 Generated with Claude Code

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

Issue: #37
@konard konard self-assigned this Sep 14, 2025
Fix ambiguous documentation for null restrictions across all ILinks methods:

- **Count**: Clarify null restriction returns 0 (safe behavior)
- **Each**: Specify null restriction processes no links (safe behavior)
- **Create**: Define null substitution creates a point (self-referencing link)
- **Update**: Establish null restriction updates no links (safer default)
- **Delete**: Emphasize null restriction deletes NO links (critical safety measure)

Key improvements:
- Replace ambiguous "no restriction" with explicit "null = safe default"
- Distinguish between null (safe, matches nothing) and Constants.Any (matches everything)
- Add safety warnings for Delete operations to prevent accidental data loss
- Ensure consistent behavior interpretation across all operations
- Update Russian translations to match new semantics

This resolves the semantic ambiguity where null restrictions could be interpreted
as either "any link" or "no link", establishing the safer "no link" interpretation
as standard behavior.

Fixes #37

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

Co-Authored-By: Claude <noreply@anthropic.com>
@konard konard changed the title [WIP] Meaning conflicts Resolve meaning conflicts for null restrictions in ILinks interface Sep 14, 2025
@konard konard marked this pull request as ready for review September 14, 2025 01:10
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.

Meaning conflicts

2 participants