Skip to content

Add readonly models for collection concepts - #130

Merged
konard merged 6 commits into
mainfrom
issue-78-e53f0780
Sep 21, 2026
Merged

konard merged 6 commits into
mainfrom
issue-78-e53f0780

Conversation

@konard

@konard konard commented Sep 10, 2025 •

Copy link
Copy Markdown
Member

Summary

Resolves #78 by adding const-only models for the mutable collection concepts:

  • CReadonlyDictionary and ReadonlyDictionary
  • CReadonlyList and ReadonlyList
  • CReadonlySet and ReadonlySet

The readonly concepts evaluate their operations through const references, so a collection can expose iteration, lookup, indexing, size, and emptiness without implementing mutation.

Additional fixes

  • Fixed the explicit-item readonly-list form so CReadonlyList<const T, Item> accepts a const item reference.
  • Fixed dependent type qualification in Dictionary and ReadonlyDictionary, allowing their Key and Value aliases to instantiate.
  • Replaced the unintegrated example and committed executable with compile-time regression coverage in the C++ test target.
  • Removed the source of all seven reported Codacy findings (four unresolved standard includes and three unused variables).
  • Updated the C++ package version from 0.3.42 to 0.3.43.

Reproduction and regression coverage

The regression types expose only const collection operations. Compile-time assertions verify:

  • readonly list, set, and dictionary concepts accept const-qualified models;
  • every supported zero-, one-, and two-argument concept form;
  • mutable concepts reject the const-only models;
  • readonly trait models instantiate and expose the expected item/key/value types.

Before the fix, the explicit-item list assertion failed and the readonly dictionary trait aliases did not instantiate.

Verification

  • CI-equivalent Conan/CMake C++ build
  • C++ test executable: 8/8 passed
  • Strict GCC C++20 compile of the regression target
  • Cppcheck pass over all changed C++ sources with no new findings
  • Repository Node policy tests: 30/30 passed
  • git diff --check

Resolves #78

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

Issue: #78
@konard konard self-assigned this Sep 10, 2025
konard and others added 2 commits September 10, 2025 18:36
Introduces CReadonlyDictionary, CReadonlyList, and CReadonlySet concepts that preserve const qualifiers instead of stripping them with std::remove_const_t. This enables proper readonly collections that only expose const methods.

- Add CReadonlyDictionaryHelpFunction that uses const Self instead of removing const qualifier
- Add CReadonlyListHelpFunction with const-only operations (size, empty, indexing)
- Add CReadonlySetHelpFunction with const-only operations (find, contains, size, empty)
- Add corresponding ReadonlyDictionary, ReadonlyList, and ReadonlySet structs
- Include test example demonstrating const qualification preservation

Fixes #78

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

Co-Authored-By: Claude <noreply@anthropic.com>
@konard konard changed the title [WIP] Add readonly[const] model to each collection's concepts Add readonly/const models for collection concepts Sep 10, 2025
@konard
konard marked this pull request as ready for review September 10, 2025 15:40
@konard

konard commented Sep 21, 2026

Copy link
Copy Markdown
Member Author

We need to get all Codacy issues resolved, see screeshots:

Screenshot 2026-09-21 at 3 55 31 PM Screenshot 2026-09-21 at 3 55 28 PM

@konard
konard marked this pull request as draft September 21, 2026 09:50
@konard

konard commented Sep 21, 2026

Copy link
Copy Markdown
Member Author

🤖 AI Work Session Started

Starting automated work session at 2026-09-21T09:50:14.848Z

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.

Runtime: solve v2.29.0 · tool codex · model gpt-5.6-sol · task image konard/hive-mind-dind:2.29.0@sha256:11a236d03854cbaea86fdd7ca06265c912cf0b67d1fcc9b3eb60bd84c43ff749

@konard konard changed the title Add readonly/const models for collection concepts Add readonly models for collection concepts Sep 21, 2026
@konard
konard marked this pull request as ready for review September 21, 2026 10:07
@konard

konard commented Sep 21, 2026

Copy link
Copy Markdown
Member Author

Working session summary

Implemented, pushed, and marked ready for review: PR #130.

Key results:

  • Added readonly dictionary, list, and set concepts/models.
  • Added compile-time regression coverage for const-only collections.
  • Fixed explicit-item list validation and dictionary trait instantiation.
  • Removed the example and binary responsible for all seven Codacy findings.
  • Bumped C++ package version to 0.3.43.
  • Merged current main; working tree is clean.
  • Fresh C++ CI, Codacy, and both CodeQL checks all pass.
  • Local C++ tests: 8/8 passed; Node policy tests: 30/30 passed.

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

@konard

konard commented Sep 21, 2026

Copy link
Copy Markdown
Member Author

🤖 Solution Draft Log

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

💰 Cost estimation:

  • Model: GPT-5.6 Sol
  • Provider: OpenAI
  • Public pricing estimate: $7.893810

📊 Context and tokens usage:

  • 140.9K / 200K (70%) input tokens, 33.6K / 128K (26%) output tokens

Total: (140.9K + 7.2M cached) input tokens, 33.6K output tokens, $7.893810 cost

🤖 Models used:

  • Tool: OpenAI Codex
  • Requested: gpt-5.6-sol
  • Thinking level: xhigh (~31999 tokens)
  • Model: GPT-5.6 Sol (gpt-5.6-sol)

📎 Log file uploaded as Gist (2486KB)


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

@konard

konard commented Sep 21, 2026

Copy link
Copy Markdown
Member Author

✅ 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 87c0e85 into main Sep 21, 2026
6 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.

Add readonly[const] model to each collection's concepts

1 participant