Skip to content

fix(server): retain latest check intervals and tags across multi-stage appends (#696) - #697

Merged
kstonekuan merged 1 commit into
Hebbian-Robotics:mainfrom
shobhitagnihotri69:fix/server-latest-check-intervals-tags
Oct 7, 2026
Merged

kstonekuan merged 1 commit into
Hebbian-Robotics:mainfrom
shobhitagnihotri69:fix/server-latest-check-intervals-tags

Conversation

@shobhitagnihotri69

Copy link
Copy Markdown
Contributor

Closes #696

Problem

In hflow-server/_catalog.py, query_latest_run_intervals and query_episode_dossier (for tags) joined intervals and tags against episodes_latest using run_fingerprint. When an episode receives multi-stage appends (e.g. Stage.META followed by Stage.LABELS or Stage.MEDIA) or incremental step runs, each append writes under a new run_fingerprint. Because episodes_latest points to the newest append's run_fingerprint, joining on i.run_fingerprint = e.run_fingerprint dropped all intervals and tags recorded by checks in earlier stages.

Solution

  • Updated query_latest_run_intervals and query_episode_dossier to join check_runs_latest AS r USING (episode_id, run_fingerprint, check_name).
  • Scopes intervals and tags to each check's latest run, matching the invariant of snapshot.py and measurements_latest (fix(curation): draw measurements_latest from each check's latest run #694).
  • Added regression test test_dossier_intervals_and_tags_survive_subsequent_stage_append in packages/hflow-server/tests/test_server_episode_dossier.py validating that intervals and tags persist across subsequent stage appends and are cleanly withdrawn if the check re-runs without them.

@greptile-apps

greptile-apps Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

[Medium risk] Changes how episode intervals and tags are queried from the database.

The PR appears safe to merge.

What we checked:

  • Tag times changing unexpectedly: The writer gives each tag and its episode the same time. The view reads that episode time for the selected check run.
Summary

Episode dossiers and timelines now show intervals and tags from each check’s latest run, even after another stage appends. When a check runs again without evidence, its older intervals and tags disappear.

  • Episode pages keep each check’s latest intervals and tags across appends.
Diagram
%%{init: {'theme': 'neutral'}}%%
flowchart LR
  A[Episode appends] --> B[Latest run for each check]
  B --> C[Intervals and tags]
  C --> D[Dossier and timeline]
Loading

Reviews (1) · Last reviewed commit: "fix(server): retain each check's latest ..."

@kstonekuan kstonekuan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, merging.

@kstonekuan
kstonekuan merged commit 3dbf43b into Hebbian-Robotics:main Oct 7, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(server): timeline intervals and dossier tags erased after multi-stage appends

2 participants