Skip to content

alerts: diaSourceId packs the source set's job and xsid (companion of rapid 665, for the 2026-12-01 review) - #248

Merged
rusholme merged 1 commit into
mainfrom
diasourceid-packed/docs
Dec 1, 2026
Merged

rusholme merged 1 commit into
mainfrom
diasourceid-packed/docs

Conversation

@rusholme

@rusholme rusholme commented Dec 1, 2026

Copy link
Copy Markdown
Collaborator

Companion of Caltech-IPAC/rapid#665: the alert packet's diaSourceId becomes the source set's job and its xsid packed into one long. Left open for the team's meeting of 2026-12-01 21:00 UTC, together with the rapid PR. That PR changes what consumers receive, and it sets aside Russ's proposal of 2026-11-24 to draw ids from database sequences: sequences need a schema change and give an id a reader cannot take back to its set without a lookup.

What this changes

  • system/alerts.md: the "where the code says more" note on diaSourceId now gives the packing rule and the two decoding operations (job = id >> 24, xsid = id & (2^24 - 1)), the widths with their headroom, and that the index's sid stays the bare xsid. The two field rows, the alert's and diaSource's, carry the new doc strings as rapid#665 generates them, and the page's provenance line names that PR for those two rows.
  • system/decisions.md: a new ruling, decision-packed-dia-source-id, with the failure seen, the reason, the measured widths and the version decision. The diaSourceId clause of decision-per-set-source-ids is marked as superseded by it.

The failure seen

The packet's diaSourceId was the bare xsid, numbered from 1 within each source set. It therefore repeated between packets and within one packet's prvDiaSources (Azalee and Jacob, #pipeline 2026-11-24).

Measured, and the split

These counts come from a read-only query on the deployed database on 2026-12-01 at 00:40 UTC:

  • The largest xsid is 8,012. The split's 24 xsid bits allow 2,094 times that.
  • The largest job id is 161,137. The split's 39 job bits allow 3.4 million times that, or about 600,000 years at the measured 2,500 jobs a day.
  • The sign bit stays clear.

The query and its full table are in rapid#665.

The version question

The schema stays 00.08. rapid_docs states no versioning rule for the alert schema. The registry's own rule is to bump on a change that is not backward compatible, and it does not call for a bump here: the type is unchanged, a 00.08 reader decodes the new packets, and only the doc strings change.

What consumers see change

diaSourceId is unique across the stream and decodes to (job, xsid). A reader that keyed a detection by its set and diaSourceId together now reads the set from the id.

Not merged here. The page describes rapid#665's behaviour and should merge with it or not at all.

…oding

The alert page's diaSourceId note and both field rows state the packing
(job << 24 | xsid) and how to decode it; decisions gains the ruling, with
the measured widths and the version decision, and marks the per-set ids
ruling's diaSourceId clause superseded. Companion of rapid PR 665.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@rusholme
rusholme merged commit 650cb86 into main Dec 1, 2026
1 check passed
@rusholme
rusholme deleted the diasourceid-packed/docs branch December 1, 2026 01:40
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.

1 participant