Skip to content

Conversation

@qnikst
Copy link
Contributor

@qnikst qnikst commented Nov 3, 2025

We introduce a structure for the information about the namespaces NamespaceInfo, that keeps an information and configuration for the namespaces.

Currently there are only two fields, but they can be excended later:

  1. namespaceSpec - Huddle specification for the namespace
  2. namespaceKeySize - size of the key

We need the latter because in the CIP we propose that all the keys in the namespaces have a statically known size. This way we can pass this information.

We use GHC Natural because later we will need that info to pass the values on the type level.

We introduce a structure for the information about the namespaces
NamespaceInfo, that keeps an information and configuration for the
namespaces.

Currently there are only two fields, but they can be excended later:
1. namespaceSpec - Huddle specification for the namespace
2. namespaceKeySize - size of the key

We need the latter because in the CIP we propose that all the keys
in the namespaces have a statically known size. This way we can
pass this information.

We use GHC Natural because later we will need that info to pass
the values on the type level.
@qnikst qnikst requested review from Copilot, joaosreis and nc6 November 3, 2025 11:59
@qnikst qnikst self-assigned this Nov 3, 2025
@qnikst qnikst added the enhancement New feature or request label Nov 3, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR refactors the namespaces data structure to include additional metadata beyond just the CDDL specification. The key change is introducing a NamespaceInfo record type that holds both the namespace specification and key size information.

  • Introduced NamespaceInfo data type to encapsulate namespace metadata (specification and key size)
  • Updated namespaces map from Map String Huddle to Map Text NamespaceInfo
  • Refactored all consumers of namespaces to extract fields from the new NamespaceInfo structure

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
scls-cddl/cddl-src/Cardano/SCLS/CDDL.hs Defines new NamespaceInfo data type and updates namespaces map to use Text keys and NamespaceInfo values
scls-cddl/scls-cddl.cabal Adds text dependency to both library and executable
scls-cddl/gen-cddl/Main.hs Updates to destructure NamespaceInfo and use Text namespace keys
scls-format/test/Roundtrip.hs Updates pattern matching to use Namespace.fromText and namespaceSpec field accessor

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@qnikst qnikst requested a review from Copilot November 3, 2025 13:13
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@qnikst qnikst merged commit 6214336 into main Nov 3, 2025
15 checks passed
@qnikst qnikst deleted the namespace-info branch November 3, 2025 14:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants