feat(inbox): surface adjudication state and its dwell time

This commit is contained in:
Kjell Tore Guttormsen 2026-09-02 14:49:45 +02:00
commit a60312a5f3
9 changed files with 219 additions and 9 deletions

View file

@ -1233,6 +1233,12 @@ SEGMENTED_V1 = BundleProfile(
)
# Bound so the sixth profile's facet extension is typed: `IndexPolicy.facets`
# is `FacetPolicy | None`, and `SEGMENTED_V1` is known here to carry one.
_SEGMENTED_FACETS = SEGMENTED_V1.index.facets
assert _SEGMENTED_FACETS is not None
# The sixth profile. A segmented bundle could not declare which upstream spec
# it targets: `SEGMENTED_V1` names `bundle_id`, `OKF_V0_2` names `okf_version`,
# and the two never intersected. Additive, as upstream support always is here --
@ -1255,7 +1261,21 @@ SEGMENTED_OKF_V0_2 = BundleProfile(
types=OKF_V0_2.types,
frontmatter=OKF_V0_2.frontmatter,
paths=SEGMENTED_V1.paths,
index=replace(SEGMENTED_V1.index, root_frontmatter=("okf_version", "bundle_id")),
# The facet tuple is EXTENDED here rather than shared, and that is the
# discriminator doing its job: `SEGMENTED_V1.index.facets` is one object
# both profiles would otherwise point at, so appending `adjudication` to it
# would surface the state under the older profile too and move a
# byte-pinned golden. `FacetPolicy.render` refuses any key a policy does
# not name, which is why the key has to live here and cannot be added by
# the door at write time.
index=replace(
SEGMENTED_V1.index,
root_frontmatter=("okf_version", "bundle_id"),
facets=replace(
_SEGMENTED_FACETS,
keys=_SEGMENTED_FACETS.keys + ("adjudication",),
),
),
ownership=OKF_V0_2.ownership,
# Constructed rather than `replace`d off `SEGMENTED_V1.segmentation`: that
# attribute is typed `| None`, and the equality is asserted in the suite so