Skip to content

chore: resolve TODOs across entity, stream, and version C++ modules#4

Open
devin-ai-integration[bot] wants to merge 3 commits into
masterfrom
devin/1777288845-resolve-entity-stream-version-todos
Open

chore: resolve TODOs across entity, stream, and version C++ modules#4
devin-ai-integration[bot] wants to merge 3 commits into
masterfrom
devin/1777288845-resolve-entity-stream-version-todos

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Apr 27, 2026

Copy link
Copy Markdown

Reference Issues/PRs

Part of TODO cleanup across C++ modules (entity, stream, version).

What does this implement or fix?

Resolves 35 TODO/FIXME comments across 20 files in the entity (12), stream (11), and version (12) C++ modules.

Straightforward TODOs resolved inline:

  • key.hpp: Clarify legacy Kestrel key types (STREAM_GROUP, GENERATION) and BACKUP_SNAPSHOT_REF as backward-compat retained
  • key.hpp: Remove outdated rename suggestion for is_index_key_type (name is correct)
  • types.hpp: Replace vague TODOs with descriptive comments about Windows wchar_t and Pandas >= 2.0 datetime resolution
  • ref_key.hpp: Document operator< design (sorts by id only, consistent with AtomKeyImpl)
  • aggregator.hpp: Clean up expected_row_size() — remove dead variable and misleading TODO (returning 0 is correct)
  • version_map_entry.hpp: Clarify why 3-arg index_to_tombstone uses 0 for start/end index (no index key available)
  • version_store_api.cpp: Remove dead TODO after return statement (unreachable code)

Non-straightforward TODOs converted to descriptive comments:

  • Performance (PERF: prefix): RefKey hash efficiency, AtomKey string interning, wide segment O(n) lookup bottleneck (×2), snapshot loading in batch operations, parallel segment splitting
  • Backward compatibility: Legacy key type character mapping, legacy field format support — documented as retained for compat
  • Feature work: Retained existing Monday tracking IDs (11526152128, 10997979275, 18190648152); documented merge update INSERT limitation, multi-partition support gap, segment rollback status
  • Platform: Windows unicode width, winnt.h macro conflict, LMDB benchmark CI dependency

No functional code changes — all modifications are comment-only.

Any other comments?

  • Storage-persisted types in key.hpp and types.hpp are untouched (only comments changed, no enum values or data layout modified)
  • Test file TODOs in test_row_builder.cpp and test_version_map.cpp reference unimplemented features (segment rollback, compact_and_remove_deleted_indexes) — converted to clear status comments
  • benchmark_write.cpp LMDB benchmarks remain disabled pending Windows CI fix
  • GitHub issues are disabled on this forked repo, so non-straightforward TODOs are documented as categorized comments rather than issue references

Checklist

Checklist for code changes...
  • Have you updated the relevant docstrings, documentation and copyright notice?
  • Is this contribution tested against all ArcticDB's features?
  • Do all exceptions introduced raise appropriate error messages?
  • Are API changes highlighted in the PR description?
  • Is the PR labelled as enhancement or bug so it appears in autogenerated release notes?

Link to Devin session: https://app.devin.ai/sessions/4805cefb5ec24bb5a3fbb5c6ba718699
Requested by: @chrischappell-cog


Open in Devin Review

Resolve 35 TODO/FIXME comments across 20 files in the entity (12), stream (11),
and version (12) C++ modules.

Straightforward TODOs resolved inline:
- key.hpp: Clarify legacy Kestrel key types and BACKUP_SNAPSHOT_REF as backward compat
- key.hpp: Remove outdated rename suggestion for is_index_key_type
- types.hpp: Replace vague TODOs with descriptive comments about Windows/Pandas compat
- ref_key.hpp: Document operator< design choice (sorts by id, consistent with AtomKey)
- aggregator.hpp: Remove misleading TODO from expected_row_size (0 is correct)
- version_map_entry.hpp: Clarify why tombstone uses 0 for start/end index
- version_store_api.cpp: Remove dead TODO after return statement

Non-straightforward TODOs converted to descriptive comments:
- Performance concerns tagged with PERF: prefix (RefKey hash, AtomKey string interning,
  wide segment bottleneck, snapshot loading, segment splitting)
- Backward compat items documented as legacy code with rationale
- Feature work items retain Monday tracking IDs where they existed
- Platform issues documented with clear context (Windows unicode, winnt.h macros)

Co-Authored-By: Chris Chappell <chris.chappell@cognition.ai>
@devin-ai-integration

Copy link
Copy Markdown
Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 3 potential issues.

View 5 additional findings in Devin Review.

Open in Devin Review

VariantType variant_type_from_key_type(KeyType key_type);

constexpr bool is_index_key_type(KeyType key_type) {
// TODO: Change name probably.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 CLAUDE.md violation: existing comment deleted without replacement in is_index_key_type

CLAUDE.md rule: "Do not delete existing comments unless they are incorrect." The comment // TODO: Change name probably. on is_index_key_type was deleted without replacement. This TODO noted a valid concern that the function name is misleading (it returns true for MULTI_KEY which isn't strictly an "index" key type). The comment was not incorrect — it was an actionable reminder that should be preserved.

Suggested change
// TODO: Change name probably.
// TODO: Change name probably.
return (key_type == KeyType::TABLE_INDEX) || (key_type == KeyType::MULTI_KEY);
Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch — restored the comment as: // Name is potentially misleading: also matches MULTI_KEY which is not strictly an index type. Converted from a vague TODO to a descriptive note while preserving the valid concern. Fixed in b6300ed.

Comment thread cpp/arcticdb/stream/stream_utils.hpp Outdated
++current_;
if (key_within_index_range(res))
return res; // TODO keep track of first / last case
return res;

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 CLAUDE.md violation: existing comment deleted without replacement in KeyRangeIterator::next

CLAUDE.md rule: "Do not delete existing comments unless they are incorrect." The inline comment // TODO keep track of first / last case on the return res; line in KeyRangeIterator::next() was deleted without replacement. This TODO noted a potentially missing feature (tracking the first/last key returned during iteration). The comment was not incorrect — it was an actionable note that should be preserved.

Suggested change
return res;
return res; // TODO keep track of first / last case
Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Valid point — restored as: // Does not track first/last key returned during iteration. Converted from TODO to descriptive comment while preserving the actionable concern. Fixed in b6300ed.


multi_index_agg.commit();
return {to_atom(std::move(multi_key_fut).get())};
// TODO: now store this in the version key for this symbol

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 CLAUDE.md violation: existing comment deleted without replacement in write_partitioned_dataframe

CLAUDE.md rule: "Do not delete existing comments unless they are incorrect." The comment // TODO: now store this in the version key for this symbol after the return statement in write_partitioned_dataframe was deleted without replacement. This TODO noted that the partition multi-key should be stored in the version key, which is a valid reminder about incomplete functionality. The comment was not incorrect.

Suggested change
// TODO: now store this in the version key for this symbol
return {to_atom(std::move(multi_key_fut).get())};
// TODO: now store this in the version key for this symbol
Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch — restored as: // Partition multi-key is not yet stored in the version key for this symbol. Even though it's after a return statement, it documents incomplete functionality. Fixed in b6300ed.

Devin Review correctly flagged 3 CLAUDE.md violations where existing comments
were deleted without replacement:
- key.hpp: Restore is_index_key_type name concern (MULTI_KEY is not strictly an index type)
- stream_utils.hpp: Restore first/last key tracking note in KeyRangeIterator
- version_store_api.cpp: Restore partition multi-key version storage note

Co-Authored-By: Chris Chappell <chris.chappell@cognition.ai>
devin-ai-integration[bot]

This comment was marked as resolved.

AtomKeyImpl::operator< uses a 5-field tuple comparison, not just id.
The original TODO's point was that neither key includes type in ordering.

Co-Authored-By: Chris Chappell <chris.chappell@cognition.ai>
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