← Back

agree devlog - 01/28

Got the first pass of the visitor working. It walks the source and outputs pydantic schemas, but dict and list types aren't parsed yet, those fields just come out empty.

Here's what the output looks like at this stage:

{
  'Event': {
    'id': ['int'],
    'name': ['str'],
    'active': ['bool'],
    'score': ['float'],
    'description': ['str', 'None'],
    'value': ['None', 'int', 'str'],
    'tags': [],
    'attrs': [],
    'metadata': [],
    'payload': ['None'],
    'created_at': ['datetime']
  },
  'EventUpdate': {
    'id': ['int'],
    'name': ['str', 'None'],
    'active': ['bool', 'None'],
    'score': ['float', 'None']
  },
  'EventSource': {'source_id': ['int'], 'kind': ['str'], 'metadata': ['None']},
  'TeamSource': {'id': ['int'], 'name': ['str'], 'country': ['str', 'None']}
}

The scalar types (int, str, bool, float, datetime) are coming through fine, and optional fields show up as ['SomeType', 'None']. Anything that resolves to a container type like tags, attrs, metadata just produces empty lists since the visitor doesn't know how to unwrap list[...] or dict[...] yet. That's next.

One known risk: the visitor uses a stack to track what class/attribute it's currently inside, which works for flat pydantic models but will probably break on anything nested I haven't thought about yet.