V3: Standardize Primary AE Objects and Synchronize Search Whitelists.
- Synchronized searchable_fields (V3 whitelists) across all Primary and Active AE objects (Identity, People, Events, Journals, Posts, Archives, Business).
- Standardized Pydantic models for core objects to include the 10 common fields (id, id_random, enable, hide, priority, sort, group, notes, created_on, updated_on).
- Fixed field aliases and uncommented valid database columns in User_Base and Organization_Base.
- Pruned non-existent fields from searchable lists in legacy or config-specific definitions (account_cfg, user_role, log_client_viewing).
- Added system discovery and validation tools:
- ae_object_info.py: AE object status and metadata browser.
- export_all_interfaces.py: E2E TypeScript interface generator.
- Verification scripts for searchable field consistency.
- Updated Jan 8 milestone progress and platform roadmap in GEMINI.md.
This commit is contained in:
60
verify_searchable_fields.py
Normal file
60
verify_searchable_fields.py
Normal file
@@ -0,0 +1,60 @@
|
||||
#!/usr/bin/env python3
|
||||
import sys
|
||||
import os
|
||||
|
||||
# Setup path to include the app directory
|
||||
sys.path.append(os.getcwd())
|
||||
|
||||
def verify_searchable_fields():
|
||||
try:
|
||||
from app.ae_obj_types_def import obj_type_kv_li
|
||||
except ImportError as e:
|
||||
print(f"Error importing object definitions: {e}")
|
||||
return
|
||||
|
||||
print(f"{'Object Type':<30} | {'Status':<10} | {'Issues'}")
|
||||
print("-" * 120)
|
||||
|
||||
total_objects = 0
|
||||
mismatched_fields = 0
|
||||
missing_searchable_attr = 0
|
||||
|
||||
for obj_type, def_kv in obj_type_kv_li.items():
|
||||
total_objects += 1
|
||||
searchable_fields = def_kv.get('searchable_fields', [])
|
||||
model = def_kv.get('mdl')
|
||||
|
||||
if not searchable_fields:
|
||||
missing_searchable_attr += 1
|
||||
print(f"{obj_type:<30} | WARNING | No searchable_fields defined")
|
||||
continue
|
||||
|
||||
if not model:
|
||||
print(f"{obj_type:<30} | ERROR | No model (mdl) defined")
|
||||
continue
|
||||
|
||||
if not hasattr(model, '__fields__'):
|
||||
print(f"{obj_type:<30} | SKIP | Model {model.__name__} has no __fields__")
|
||||
continue
|
||||
|
||||
# Collect all valid field names: variable names AND aliases
|
||||
valid_fields = set()
|
||||
for field_name, field_obj in model.__fields__.items():
|
||||
valid_fields.add(field_name)
|
||||
if field_obj.alias:
|
||||
valid_fields.add(field_obj.alias)
|
||||
|
||||
mismatches = [f for f in searchable_fields if f not in valid_fields]
|
||||
|
||||
if mismatches:
|
||||
mismatched_fields += len(mismatches)
|
||||
print(f"{obj_type:<30} | MISMATCH | {', '.join(mismatches)}")
|
||||
|
||||
print("-" * 120)
|
||||
print(f"Summary:")
|
||||
print(f"Total Objects Checked: {total_objects}")
|
||||
print(f"Objects missing searchable_fields: {missing_searchable_attr}")
|
||||
print(f"Total Field Mismatches found: {mismatched_fields}")
|
||||
|
||||
if __name__ == "__main__":
|
||||
verify_searchable_fields()
|
||||
Reference in New Issue
Block a user