Skip to content

feat(api): completion events link to results; recovery by polling (#1232) - #1243

Merged
athvin merged 2 commits into
mainfrom
issue/1232-event-links
Nov 25, 2026
Merged

athvin merged 2 commits into
mainfrom
issue/1232-event-links

Conversation

@athvin

@athvin athvin commented Nov 25, 2026 •

Copy link
Copy Markdown
Owner

Closes #1232

🚧 Claimed by an agent session — 2026-11-25T19:53:24Z, session Claude Code:d1e3b2dc-3174-4091-9c30-c08fc4820306 on Mac.
The claim is this open draft PR: closing it releases the claim.

Post-merge is part of this pull request. The ledger below records whether
the follow-up work actually happened. /land-pr closes it.

What

job.* webhook payloads now say where the results are:

  • A run (run_all_*, correct, apply_corrections) carries run_id. On success it also carries the snapshot holding its results and links.golden_records / links.duplicates that read exactly that snapshot, plus links.runs.
  • An export carries export_id, its snapshot, links.status, and links.download once it succeeded.

How the snapshot gets there: the control plane cannot open a lake. So finish (via er_cli::write_run_end, which now returns the snapshot it stamps) publishes it in FinishReport. That is the same output path the entity counts already cross by (O3c-2), and the executor reads it at settle.

Recovery without a re-run: GET …/runs serves each run's snapshot (#1229), so a subscriber that missed the delivery polls the same number. The job.succeeded catalog description says so.

Why

#1232, part of #521.

Proof

make check: 1,194 passed, 0 failed. er-server + er-cli --tests against Postgres with DEDUPE_E2E_DUCKLAKE=1: 502 passed. make frontend: 963 passed, 1 failed (grow.spec.ts:339, mobile-safari). This PR changes no frontend file. The single failing mobile-safari spec has been a different spec on each of the last three local runs, which is the shard-flake pattern; the required Playwright tier is the judge.

  • job_event_data_tests (4):
    • a succeeded run gets the exact payload, with links;
    • a failed run gets run_id, no snapshot and no links;
    • an export's download link appears only once it succeeded;
    • a dataset-less job is the bare outcome.
  • run_snapshot_read.rs: the announced snapshot equals the one GET …/runs serves. That is the event route and the poll route agreeing.
  • plans.rs: the settle path's unchecked output["doc"]["snapshot"] key round-trips, next to the existing entity_counts one.
Mutation Caught by
an export's download linked before it succeeded an_export_links_its_download_only_once_it_succeeded

Risk & rollback

Additive payload fields: a subscriber that ignores unknown keys is unaffected. FinishReport.snapshot is #[serde(default)], so older task rows still read. The other emit_job_event call sites (cancel, the legacy helper) pass None. Rollback: git revert <merge-sha>.

Post-merge ledger

Closed by: agent · session Claude Code:d1e3b2dc-3174-4091-9c30-c08fc4820306 on Mac · 2026-11-25T20:25:36Z

Specific to this change

Context — plan, discoveries, measurements, files

Plan

Discoveries

Measurements

Files

…1232)

finish returns the snapshot holding the run's results and publishes it in
FinishReport, the same unchecked output path the entity counts cross by,
because the control plane cannot open a lake. job.succeeded for a run
carries run_id, snapshot and links that read exactly it; an export carries
export_id and its status/download links. run_snapshot_read.rs proves the
announced snapshot is what GET …/runs serves, so a missed delivery is
recovered by polling without a re-run.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@athvin
athvin marked this pull request as ready for review November 25, 2026 20:11
@athvin
athvin merged commit 376da16 into main Nov 25, 2026
45 checks passed
@athvin
athvin temporarily deployed to marketing-preview November 25, 2026 20:13 — with GitHub Actions Inactive

This branch was previously deployed

1 inactive deployment
marketing-preview — 65dd3157 Deployed Nov 25, 2026 by athvin via remove closed PR previews #58
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.

E11.5 — Completion events link to results; recovery without re-running

2 participants