feat!: replace hash-based IDs with semantic versioning for variant ID generation #163
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Replace hash-based IDs with semantic versioning for variant ID generation
Summary
This MR replaces the hash-based variant ID generation system with a semantic versioning approach that provides better traceability and human-readable IDs. Variant increments are now automatically tied to changes detected by GraphQL Inspector.
What Changed
New Variant ID System
Concept/vM.m(e.g.,Vehicle.speed/v1.0)GraphQL Inspector Integration
New:
graphql_inspector_diff.js- Node.js script using@graphql-inspector/coreAPINew:
diff_parser.py- Python module to process GraphQL Inspector outputArchitecture Changes
Removed:
src/s2dm/idgen/module (old hash-based system)Added:
src/s2dm/registry/module with:variant_ids.py: Models for semantic version-based variant IDsconcept_uris.py: Concept URI registry managementspec_history.py: Spec history trackingsearch.py: Moved from tools (previouslyskos_search.py)Added:
src/s2dm/tools/graphql_inspector_diff.js- Structured diff generationAdded:
src/s2dm/tools/diff_parser.py- Diff output processingUpdated:
src/s2dm/tools/graphql_inspector.py- Integration with new diff systemCLI Changes
registrycommands now require--version-tagparameterregistry updaterequires--previous-idsparameter--diff-fileparameter for providing structured diffs from GraphQL Inspector--strict-modeoption fromregistry idcommandHow It Works
s2dm diff graphqluses GraphQL Inspector to compare old and new schemasExample workflow:
Breaking Changes
idgenmodule: The hash-based ID generation system has been completely removed--version-tagis now required forregistry id,registry init, andregistry update--previous-idsis now required forregistry update--strict-modeoption removed fromregistry idvM.m) instead of content hashes@graphql-inspector/corenpm package for diff generationDocumentation
src/s2dm/exporters/README.mdwith variant ID documentationsrc/s2dm/registry/README.mdwith registry module overviewexamples/spec-history-registry/README.mdwith new CLI usageTesting
Added tests covering:
Updated E2E CLI tests for new registry commands.
Test Infrastructure Improvements
GraphQL Inspector Test Marker: Implemented explicit test management for GraphQL Inspector dependencies:
@pytest.mark.graphql_inspectormarker for tests requiring npm dependenciesinspector_pathpytest fixture that auto-locatesnode_modulesdirectory@graphql-inspector/clinot installedpytest -m "not graphql_inspector"CONTRIBUTING.mdRelated to #153