diff --git a/.agents/skills/lib_py/atomic_yaml.py b/.agents/skills/lib_py/atomic_yaml.py index 8e891ad..1233b03 100644 --- a/.agents/skills/lib_py/atomic_yaml.py +++ b/.agents/skills/lib_py/atomic_yaml.py @@ -124,6 +124,17 @@ def atomic_dump_yaml_main(): if from_version < registry_format.CURRENT: d, migrated_rows = registry_format.migrate(d) force_yaml = True + elif row: + # The DB is current; its YAML copy may not be (a migration whose + # YAML rewrite failed after the DB commit). Then rewrite it. + y = None + if os.path.exists(yaml_path): + try: + with open(yaml_path) as f: + y = yaml.safe_load(f) + except Exception: + y = None + force_yaml = registry_format.stored_version(y) < registry_format.CURRENT old_sessions = get_all_sessions_status(d) # a mutation that replaces a row the monitor registered for a pane it