forked from cleveragents/cleveragents-core
44 lines
1.7 KiB
Gherkin
44 lines
1.7 KiB
Gherkin
@discovery
|
|
Feature: Data Contract Extraction
|
|
As a CleverAgents developer
|
|
I want to extract data contracts from Plandex shared Go code
|
|
So that I can generate Python dataclass equivalents
|
|
|
|
Background:
|
|
Given the Plandex repository exists at "../plandex"
|
|
And the shared directory contains Go contract files
|
|
|
|
Scenario: Extract structs from Go files
|
|
When I run the data contract extractor
|
|
Then contracts should be extracted from multiple modules
|
|
And each contract should contain structs with fields
|
|
And struct fields should have type information
|
|
And JSON tags should be preserved
|
|
|
|
Scenario: Extract enums and type aliases
|
|
When I run the data contract extractor
|
|
Then enums should be identified from const blocks
|
|
And type aliases should be extracted
|
|
And each enum should have a list of values
|
|
|
|
Scenario: Generate Python dataclass stubs
|
|
When I run the data contract extractor
|
|
And I generate Python stubs
|
|
Then Python files should be created for each module
|
|
And dataclasses should match Go struct definitions
|
|
And field types should be converted to Python types
|
|
And optional fields should use Optional type hints
|
|
|
|
Scenario: Generate example fixtures
|
|
When I run the data contract extractor
|
|
And I generate example fixtures
|
|
Then JSON fixtures should be created for each struct
|
|
And fixtures should contain valid example data
|
|
And field names should use JSON tags when present
|
|
|
|
Scenario: Save contracts as JSON and YAML
|
|
When I run the data contract extractor
|
|
And I save the contracts
|
|
Then a JSON file should be created with all contracts
|
|
And a YAML file should be created with all contracts
|
|
And both files should contain the same data structure |