MicroFish/backend
Jeffery 4ea13403bf Prevent graph builds from crashing on legacy ontology attributes
Legacy ontology payloads could be saved with attributes as free-form maps of attribute names to descriptions. The graph build path dereferenced attr_def["name"] directly, which raised a KeyError before the Zep ontology request. This adds a shared ontology normalizer, applies it when validating generated ontologies and when setting graph ontology, and adds regression tests for both normalization and graph-builder compatibility.

Constraint: The configured OpenAI-compatible provider guarantees valid JSON but not strict schema adherence for ontology attributes
Rejected: Guard only graph_builder.set_ontology against missing keys | would leave malformed ontologies persisted and unvalidated upstream
Confidence: high
Scope-risk: narrow
Reversibility: clean
Directive: Keep ontology payloads normalized at service boundaries so new generations and saved legacy projects share one schema contract
Tested: Targeted backend pytest for ontology normalization in the docker compose runtime
Tested: Python compileall for backend app and tests in the docker compose runtime
Tested: Reproduced the original saved project payload through graph_builder.set_ontology with a stubbed client
Not-tested: Live Zep API round-trip against the upstream service
2026-04-21 12:33:45 -07:00
..
app Prevent graph builds from crashing on legacy ontology attributes 2026-04-21 12:33:45 -07:00
scripts Add UTF-8 encoding support for Windows in simulation_runner.py and run_parallel_simulation.py to resolve character encoding issues with third-party libraries. 2025-12-26 18:14:57 +08:00
tests Prevent graph builds from crashing on legacy ontology attributes 2026-04-21 12:33:45 -07:00
pyproject.toml fix(file_parser): handle non-UTF-8 encoded text files with automatic encoding detection 2026-01-22 18:28:37 +08:00
requirements.txt fix(file_parser): handle non-UTF-8 encoded text files with automatic encoding detection 2026-01-22 18:28:37 +08:00
run.py Add UTF-8 encoding support for Windows console in run.py and logger.py to prevent character encoding issues 2025-12-26 17:58:48 +08:00
uv.lock fix(file_parser): handle non-UTF-8 encoded text files with automatic encoding detection 2026-01-22 18:28:37 +08:00