Skip to content

feat(schema): v2.0.0 extension schema — citations, provenance, schema version#20

Merged
LittleCoinCoin merged 9 commits intoCrackingShells:mainfrom
HartreeY:feat/schema-v2.0.0-extension
Apr 15, 2026
Merged

feat(schema): v2.0.0 extension schema — citations, provenance, schema version#20
LittleCoinCoin merged 9 commits intoCrackingShells:mainfrom
HartreeY:feat/schema-v2.0.0-extension

Conversation

@HartreeY
Copy link
Copy Markdown
Contributor

@HartreeY HartreeY commented Apr 15, 2026

Support for Hatch-Schemas' new v2.0.0 package schema. #19
The validator now fully supports v2.0.0 packages while maintaining backward compatibility.

Core Implementation

  • Schema Version Routing: Updated PackageService to support both hatch_schema_version and package_schema_version for backward compatibility
  • v2.0.0 Registration: Added v2.0.0 support in ValidatorFactory and HatchPkgAccessorFactory
  • v2.0.0 Modules Created:
    • accessor.py - Authors array access, tools desc field handling
    • validator.py - Main validator with strategy composition
    • schema_validation.py - Uses v2.0.0 schema
    • dependency_validation.py - Docker digest required, version_constraint rejected
    • tools_validation.py - Desc field preferred over deprecated description
    • entry_point_validation.py - v2.0.0 entry point validation
    • provenance_validation.py - Provenance validation (rejects created_by/created_at)
    • citations_validation.py - Citations array validation

Test Coverage

  • test_v2_0_0_integration.py: End-to-end testing with official published examples
  • test_package_validator_for_v2_0_0.py: Unit tests covering schema routing, authors array, tools desc field, Docker requirements, provenance, and citations validation

Key v2.0.0 Features

  • Authors: Array of author objects (vs single author in v1.x)
  • Tools: desc field preferred, description deprecated but supported
  • Docker Dependencies: digest required, version_constraint rejected, tag optional
  • Provenance: Removed unsupported created_by/created_at fields
  • Citations: Must be an array
  • Schema Fetching: Uses 2.0.0 schema version

Validation & Testing

  • Existing tests pass (backward compatibility maintained)
  • New tests validate official examples and v2.0.0 behaviors
  • Schema routing works for both field names

HartreeY and others added 9 commits April 15, 2026 23:24
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Remove ToolsValidation and EntryPointValidation imports and assignments.
validate_tools and validate_entry_point now delegate via next_validator.
validate_dependencies delegates Hatch/Python/System to v1.2.2 via next_validator
and handles only the Docker-specific subset owned by v2.0.0.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Remove validate_dependencies override — base class default delegates it
fully to v1.2.2 for Hatch/Python/System.

Add validate_docker_dependencies as a new v2.0.0-only concern, following
the same pattern as validate_provenance and validate_citations. validate()
calls it directly alongside the other new concerns.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Deleted 13 tautological tests from test_package_validator_for_v2_0_0.py
(all asserting only isinstance(errors, list) or restating implementation)
and deleted test_v2_0_0_integration.py entirely (7/7 tests either checked
factory boilerplate or depended on GitHub HTTP fetches that 404).

Kept: test_authors_array_access (v2.0.0 structural change: authors is an
array), test_v2_0_0_validator_can_handle, test_v2_0_0_accessor_can_handle.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@LittleCoinCoin LittleCoinCoin force-pushed the feat/schema-v2.0.0-extension branch from 322ea87 to c4f6f81 Compare April 15, 2026 14:26
@LittleCoinCoin LittleCoinCoin marked this pull request as ready for review April 15, 2026 14:34
@LittleCoinCoin LittleCoinCoin merged commit 9c1b618 into CrackingShells:main Apr 15, 2026
1 check passed
cracking-shells-semantic-release Bot pushed a commit that referenced this pull request Apr 15, 2026
## 0.9.0 (2026-04-15)

* Merge pull request #20 from HartreeY/feat/schema-v2.0.0-extension ([9c1b618](9c1b618)), closes [#20](#20)
* fix(test): use get_field("author") matching accessor convention ([c4f6f81](c4f6f81))
* test(schema-v200): drop tautological tests, keep 3 behavioral ([88767e8](88767e8))
* refactor(schema-v200): delegate non-docker deps to v1.2.2 ([8255279](8255279))
* refactor(schema-v200): delegate tools and entry-point to chain ([1509b51](1509b51))
* refactor(schema-v200): drop citations and provenance strategies ([f5f4fb1](f5f4fb1))
* refactor(schema-v200): own docker dep validation exclusively ([113c578](113c578))
* refactor(schema-v200): remove citations and provenance dead code ([5b5d728](5b5d728))
* refactor(schema-v200): remove over-owned strategies from validator ([150a1ad](150a1ad))
* feat(schema): add v2.0.0 schema with citations and provenance ([52a0d78](52a0d78))
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.

Support schema v2.0.0 (citations, provenance, hatch_schema_version, breaking field changes)

2 participants