Earned auto-apply (fire + observability + UI), retrain cadences, Explore arrow-nav #143

Merged
bvandeusen merged 8 commits from dev into main 2026-06-29 07:30:41 -04:00
Showing only changes of commit 9326a82b29 - Show all commits
+6 -2
View File
@@ -882,18 +882,22 @@ def snapshot_head_metrics() -> int:
) )
) )
} }
# .all() first: dict() of a bare Result tries the mapping protocol (a
# Result exposes .keys()) and subscripts it, which fails.
applied = dict( applied = dict(
session.execute( session.execute(
select(image_tag.c.tag_id, func.count()) select(image_tag.c.tag_id, func.count())
.where(image_tag.c.source == "head_auto") .where(image_tag.c.source == "head_auto")
.group_by(image_tag.c.tag_id) .group_by(image_tag.c.tag_id)
) ).all()
) )
tag_ids = set(heads) | set(metrics) tag_ids = set(heads) | set(metrics)
if not tag_ids: if not tag_ids:
return 0 return 0
names = dict( names = dict(
session.execute(select(Tag.id, Tag.name).where(Tag.id.in_(tag_ids))) session.execute(
select(Tag.id, Tag.name).where(Tag.id.in_(tag_ids))
).all()
) )
for tid in tag_ids: for tid in tag_ids:
h = heads.get(tid) h = heads.get(tid)