Skip to content

Reference pages: alert packet fields at 00.08, products, quality, tiling, acronyms, access - #246

Merged
rusholme merged 1 commit into
mainfrom
docs-placeholders/1-pages
Dec 1, 2026
Merged

rusholme merged 1 commit into
mainfrom
docs-placeholders/1-pages

Conversation

@rusholme

@rusholme rusholme commented Dec 1, 2026

Copy link
Copy Markdown
Collaborator

What and why

These are the reader-facing placeholder pages the 2026-11-30 cutover planning session asked for, so that an outside reader can find what each alert packet field means before the first community release. Each page was read from rapid rebuild at ce36bb4a (ce36bb4a45432c54db4f8b3d34a9c9b2d5b1765c, 2026-11-30) and names that commit.

  • system/alerts.md (existing page, extended): adds a section, "The alert packet, schema 00.08". It covers all nine records and every field, with type, whether the pipeline fills it, and meaning. The tables are generated from param_registry.py, where gen_schema --check reports the .avsc files identical. Notes follow wherever the code says more than the doc string, or contradicts it. The status line now says the stage is retired and the packet section is current. The page's Scope line in system/index.md is updated to match.
  • project/day-one.md (existing page, extended): adds a blobless-clone line, git clone --filter=blob:none -b rebuild …. The existing -b rebuild instructions are unchanged, since switch-day-drafts changes them on switch day.
  • New section reference/, added to the home toctree beside System, Project and Log:
    • index.md
    • products.md: what each stage makes and its format
    • quality.md: status and InfoBits per table, the reference InfoBits with thresholds, the difference catalog-outcome mask, refimmeta's columns, the difference job's quality numbers and the gate
    • tiling.md: the Roman tessellation and the HEALPix indexes
    • acronyms.md
    • access.md

Files

index.md, project/day-one.md, system/alerts.md, system/index.md, reference/{index,products,quality,tiling,acronyms,access}.md.

Sources of each page

Page Read from (rapid at ce36bb4a unless stated)
alert packet rapidpipe/science/alerts/param_registry.py, schema/00/08/*.avsc, assemble.py (assemble_alert), stages/packet.py, settings/foundation-thin.toml [packet], database/schema.sql (xsources, xobjects, diffimages)
products the docstrings and written names of stages/intake.py, psf.py, reference.py, difference.py, packet.py; science/difference/sfft.py; [reference.mosaic]
quality database/schema.sql, cdf/infobitsref.txt, science/reference/infobits.py, products/diffimage.py, science/difference/metrics.py, [reference.infobits], [gate]
tiling database/modules/utils/roman_tessellation.py, rapidpipe/products/spatial.py, [reference.mosaic]
acronyms the code, this site's pages, and each defining organisation's public page, read 2026-12-01 (linked per row)
access already-public pages of this site only: the home page, system/specification.md (Constraints, Edges), decisions.md decision-latency, project/index.md, project/team.md. Nothing on the page is attributed to the code

The field tables were generated with this script, kept out of the repo as the card asks (rapid_docs keeps no generators):

# gen_alert_fields.py; run as PYTHONPATH=<rapid checkout at ce36bb4a> python gen_alert_fields.py
from rapidpipe.science.alerts.param_registry import RECORDS, VERSION, Status

def render(t):
    if isinstance(t, str):
        return t[1:] if t.startswith("@") else t
    if isinstance(t, list):
        parts = [render(x) for x in t]
        if parts and parts[0] == "null":
            return " or ".join(parts[1:]) + ", nullable"
        return " or ".join(parts)
    if isinstance(t, dict) and t.get("type") == "array":
        return f"array of {render(t['items'])}"
    return str(t)

def cell(s):
    return " ".join(str(s).split()).replace(" -- ", "; ").replace("|", "\\|")

# The alert record's own fields are set by assemble.assemble_alert, not by
# build_record, so the registry status does not decide them; read from the code.
ALERT_FILLED = {"prvDiaForcedSources": "yes", "ssMatches": "when the solar-system match runs"}

order = ["alert"] + [r.name for r in RECORDS if r.name != "alert"]
by = {r.name: r for r in RECORDS}
for name in order:
    r = by[name]
    print(f"\n### The `{name}` record\n\n{cell(r.doc)}.\n")
    print("| Field | Type | Filled | Meaning |\n|---|---|---|---|")
    for p in (p for p in r.params if p.status is not Status.NOT_USED):
        filled = "yes" if p.status is Status.IMPLEMENTED else "no, always null"
        if name == "alert" and p.name in ALERT_FILLED:
            filled = ALERT_FILLED[p.name]
        print(f"| `{p.name}` | {cell(render(p.avro))} | {filled} | {cell(p.doc)} |")
    skipped = [p.name for p in r.params if p.status is Status.NOT_USED]
    if skipped:
        print(f"\nDeclared but not in the schema: {', '.join('`'+s+'`' for s in skipped)}.")

The tiling numbers came from ring_z, nrabins, _BOUND and dec_at in roman_tessellation.py. Ring 1 is 5.48 × 4.31 arcmin, ring 512 is 6.00 × 3.93 arcmin, and ring 1024 is 4.48 × 5.27 arcmin. Every tile is 23.60 to 23.61 arcmin², and the mean is 23.605.

Divergences and implementation choices

  • The alert fields go on system/alerts.md, as the card says, even though the page is otherwise the retired stage's record. The packet section comes first, and its status line marks it current. The new Reference section links to it instead of keeping a second copy.
  • New pages go in a new top-level section, Reference. They are reader references, not design pages, so system/ was the wrong place. They carry no Status line, because system/'s status vocabulary is for design pages. Each page names the commit it was read from.
  • Doc strings are copied verbatim, apart from two substitutions. " -- " became "; " so that Sphinx smartquotes does not turn it into a dash, and "|" is escaped. Wherever the code contradicts a doc string, a note under the tables says so. The doc string itself is not rewritten, because the schema files carry the wording.
  • The "Filled" column comes from the registry's status for nested records, which build_record enforces. For the alert record it comes from assemble_alert. The registry marks prvDiaForcedSources as STUB, but the stage fills it.
  • diaSourceId is described as the code has it: xsid, numbered from 1 within each source set. Its meaning is left alone. diasourceid-packed edits that note when it lands.

Measurements

None. This is a docs-only change.

Improvements seen (not applied)

  • param_registry.py doc strings still say "(stub)" for implemented fields: diaSource.apFlux and apFluxErr, diaForcedSource.scienceFlux and scienceFluxErr, and the ssMatch record. prvDiaForcedSources is marked STUB but filled. nDiaSources says "over the whole history" but counts to the trigger. pid says "science image" but is the diffimages row. These lines belong in a schema bump in rapid.
  • The stages/packet.py docstring says ssMatches is "null (not run: deferred by the plan)", but [packet] ss_match = true and _catalog_matches runs it.
  • The registry comment says the derived centroid_flag and psfFlux_flag are "ALWAYS False on the wire". That held on the sources path. On the xsources path the triggers are cut on SExtractor FLAGS = 0 while psfFitFlags is the separate fit's mask, so they can be true.

Session notes

The PIT document that holds RAPID's commitments ("Roman PIT Data Products User Documentation", 2026-02-18) could not be confirmed as public, and no public URL was found. The access page therefore rests on this site's own pages alone, as the card asks for anything whose public status is unclear.

For the next task

diasourceid-packed's companion PR edits the alert section's first note (the diaSourceId / xsid bullet) and the diaSourceId rows in the generated tables. The anchor of the section is #the-alert-packet-schema-0008, and reference/index.md, reference/products.md and reference/access.md link to it.

Left

The access page names no Kafka endpoint, MAST delivery, archive cadence, file format or alert size. None of these is on an already-public page.

🤖 Generated with Claude Code

…ing, acronyms, access; blobless clone on day one

Placeholders before the first community release, each read from rapid
rebuild at ce36bb4a.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@rusholme
rusholme merged commit 7e07403 into main Dec 1, 2026
1 check passed
@rusholme
rusholme deleted the docs-placeholders/1-pages branch December 1, 2026 00:31
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