Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions docs/output-formats-and-report-specs.md
Original file line number Diff line number Diff line change
Expand Up @@ -1125,9 +1125,13 @@ A count a routine could not establish is `None`, never `0` and never the cap (#5

Measured results are unchanged. Since 6.2.28 there is no exception to "never `0`": a `viewer` count whose query fails is `None` with a note too, whatever `strict` says (6.2.27 still returned `0` there unless `strict=True`). `strict` is still accepted, and changes nothing.

**Scans (6.2.28).** A figure computed from a scan, rather than from a native count, is only a figure when the scan read everything. The relationship scans (`orphan_glossary_terms`, `certifications_summary`, `contextualised_coverage`, `solution_component_realisation`, `active_contributors`, `engagement_series`, the DataFlow lineage in `ai_ready_assets`/`drl_readiness_gates`, and `count_relationships` in the viewer population) and the element finds of `governed_coverage`, `ownership_coverage` and `karma_leaderboard` page until Egeria returns an **empty** page. That is Egeria's paging contract: a short page is not the last page. A scan that cannot finish (more than `MAX_SCAN_PAGES` pages, 40 by default, or a server that repeats its page) is `None` with a note, never a figure from the part it read. `stale_assets`, `ai_ready_assets` and `drl_readiness_gates` read one page of Assets, which is too many to page through; when that page is full, their figures are `None` with a note (`capped` is `true` for the readiness routines), because a page of Assets is a sample, not the catalog. In 6.2.27 `orphan_glossary_terms` read one 500-relationship page that held 8 distinct terms, so it reported 1,053 orphans where all 747 relationships give 984.
**Scans (6.2.28).** A figure computed from a scan, rather than from a native count, is only a figure when the scan read everything. The relationship scans (`orphan_glossary_terms`, `certifications_summary`, `contextualised_coverage`, `solution_component_realisation`, `active_contributors`, `engagement_series`, the DataFlow lineage in `ai_ready_assets`/`drl_readiness_gates`, and `count_relationships` in the viewer population) and the element finds of `governed_coverage`, `ownership_coverage` and `karma_leaderboard` page until Egeria returns an **empty** page. That is Egeria's paging contract: a short page is not the last page. A scan that cannot finish (more than `MAX_SCAN_PAGES` pages, 40 by default, or a server that repeats its page) is `None` with a note, never a figure from the part it read. `ai_ready_assets` and `drl_readiness_gates` read one page of Assets, which is too many to page through; when that page is full, their figures are `None` with a note (`capped` is `true`), because a page of Assets is a sample, not the catalog. (`stale_assets` did the same in 6.2.28; see **Counting by update time** below.) In 6.2.27 `orphan_glossary_terms` read one 500-relationship page that held 8 distinct terms, so it reported 1,053 orphans where all 747 relationships give 984.

**Population (#556, 6.2.27).** The count routines take `population=` (`"viewer"` or `"repository"`; `scope=` is a deprecated alias and passing both with different values is a `ValueError`). They now default to `"repository"`: totals count the whole repository, **including elements the viewer may not be able to see**, via the native push-down count. This is a deliberate interim choice until zone-aware push-down exists, and the registry descriptions say so. `"viewer"` is an explicit opt-in; `scope=None` omits the argument and takes the server default. A failed repository count has no find fallback, so it is `None` with a note, strict or not. Routines that scan elements (for example `certifications_summary`, `orphan_glossary_terms`, `stale_assets`) stay viewer-scoped, and no payload mixes the two populations in one ratio.
**Population (#556, 6.2.27).** The count routines take `population=` (`"viewer"` or `"repository"`; `scope=` is a deprecated alias and passing both with different values is a `ValueError`). They now default to `"repository"`: totals count the whole repository, **including elements the viewer may not be able to see**, via the native push-down count. This is a deliberate interim choice until zone-aware push-down exists, and the registry descriptions say so. `"viewer"` is an explicit opt-in; `scope=None` omits the argument and takes the server default. A failed repository count has no find fallback, so it is `None` with a note, strict or not. Routines that scan elements (for example `certifications_summary`, `orphan_glossary_terms`) stay viewer-scoped, and no payload mixes the two populations in one ratio. `stale_assets` is in the repository population from 6.2.29.

**Counting by update time (6.2.29).** Egeria cannot count by an update-time condition: a search condition reaches only an element's own properties, and `updateTime` is in its header, so a count with `updateTime LT <cutoff>` answers 0. Egeria can sort by update time (`sequencingOrder: LAST_UPDATE_OLDEST`), and `startFrom` is an offset into the repository's own sorted rows: a row the viewer cannot see keeps its offset and comes back as an empty one-row page. So `stale_assets` counts the Assets last updated before the cutoff as the offset of the first row updated at or after it, found by bisection: about log2(total / 25) one-row reads, then one read of the last window of at most 25 rows (12 reads for 37,000 Assets). A hidden row between two rows updated before the cutoff was updated before it too, so `staleCount` is in the repository population, like its `assetTotal`. Only hidden rows exactly at the cutoff cannot be placed; then `staleCount` is `None` with a note giving the range. Live, as `erinoverview` on 2026-11-09: 287 of 37,568 Assets in 13 s, where 6.2.28 took 35 s to report "not measured".

**Distinct relationship ends cannot be counted natively.** `orphan_glossary_terms` therefore still scans every `SemanticAssignment` relationship (about 8 KB each). Its term total is a viewer count, to match the scan's population, and that is slow (13.5 s live for 1,061 terms, against 0.7 s in the repository population); from 6.2.29 it runs on its own thread while the scan pages.

#### Routines, declarations and roles

Expand Down
17 changes: 17 additions & 0 deletions docs/release-notes/6.2.29.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,20 @@
- A find stage's `additional_props` names the per-element hook (`FormatSet.get_additional_props`). Only the
functions on `ADDITIONAL_PROPS_HOOKS` are allowed.
- A formatter's `same_as` shares an earlier output format's formatter, as a `Format` with several types does.

- **`stale_assets` gives a real answer.** It read one page of 500 Assets, so on any catalog with
more Assets its `staleCount` was `None` ("not measured") every time, and it took about 35 s to say
so (most of it a viewer Asset count that timed out). Egeria cannot count by an update-time
condition, but it sorts by update time, and `startFrom` is an offset into the repository's own
sorted rows. So `staleCount` is now the offset of the first Asset updated at or after the cutoff,
found by bisection: about log2(Assets / 25) one-row reads, then one read of the last window of at
most 25 rows. Live, as `erinoverview`: 287 of 37,568 Assets, in 13 s. Both figures are now in the
**repository** population (they include Assets you may not be able to see); 6.2.28 counted
`assetTotal` in the viewer population. `staleCount` is `None` with a note when Assets you cannot
see sit exactly at the cutoff (the note gives the range), when a read fails, or when the
bisection's 64 reads run out. The declaration says `population="repository"` for both measures,
and `staleCount` has `assetTotal` as its basis.
- **`orphan_glossary_terms` is faster.** Distinct relationship ends cannot be counted natively, so
it still scans every `SemanticAssignment` relationship. Its viewer term count (13.5 s live) now
runs on its own thread while the scan pages: 22.6 s became 16.8 s live, with the same answer (984
orphans of 1,061 terms).
32 changes: 18 additions & 14 deletions pyegeria/view/analytic_registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -1761,10 +1761,11 @@ def _always_applies(what: str) -> str:
inputs=["egeria_client:MetadataExpert", "egeria_client:ClassificationExplorer"],
description="Approved-but-unassigned glossary terms -- a term with no SemanticAssignment "
"relationship to anything was authored but never put to use grounding the "
"catalog. One bounded SemanticAssignment fetch, distinct GlossaryTerm-end GUID "
"count is the 'referenced' set; orphan = term total - referenced. Takes two "
"catalog. Every SemanticAssignment relationship, paged until Egeria returns an empty "
"page; the distinct GlossaryTerm-end GUID count is the 'referenced' set (Egeria cannot "
"count distinct relationship ends natively); orphan = term total - referenced. Takes two "
"leading clients (mgr, ce), same convention as semantic_grounding. "
"Cost: one count plus one relationship scan, paged until Egeria returns an empty page, seconds.",
"Cost: one viewer count, run at the same time as one relationship scan, seconds.",
returns="dict (termTotal, referencedCount, orphanCount)",
generic=False,
binding_note="Fixed to the SemanticAssignment relationship type and GlossaryTerm elements -- not a parameter.",
Expand Down Expand Up @@ -1797,10 +1798,13 @@ def _always_applies(what: str) -> str:
function="pyegeria.view.overview_metrics.stale_assets",
inputs=["egeria_client:MetadataExpert"],
description="Assets with no update in the last N days (default 180) -- candidates for "
"archival review. One bounded Asset element fetch, each element's own version "
"metadata compared against the cutoff, no relationship traversal. "
"Cost: one Asset find page (a full page is a sample, so staleCount is not measured) plus one "
"count, seconds.",
"archival review. Egeria cannot count by update time, but it sorts by it, so the "
"stale count is a bisection over the Assets' offsets in update-time order, using "
"one-row reads, never a page of Assets."
+ REPOSITORY_WORDS +
" Cost: one native count plus about log2(Assets / 25) one-row reads and one 25-row read (12 for "
"37,000 Assets), "
"seconds.",
returns="dict (staleCount, assetTotal)",
generic=False,
binding_note="Fixed to the Asset type -- population isn't a parameter, but the staleness threshold (days) is.",
Expand All @@ -1810,18 +1814,18 @@ def _always_applies(what: str) -> str:
],
declaration=AnalyticDeclaration(
result_kind="measure",
# staleCount comes from one find page (None when full), assetTotal from a native count: no basis.
# Both in the repository population: the bisection's offsets are the repository's own rows.
measures=[
_measure("stale_assets", "Assets not updated within `days` (not measured when the Asset find fills its page)",
"staleCount", population="viewer"),
_measure("assets", "Assets", "assetTotal"),
_measure("stale_assets", "Assets not updated within `days`", "staleCount",
population="repository", basis=_basis("assetTotal", "Assets")),
_measure("assets", "Assets", "assetTotal", population="repository"),
],
absence=_absence(
not_measured="Stale assets were not measured: the Asset find failed, or it filled its page, "
"so it held only some of the Assets.",
not_measured="Stale assets were not measured: the Asset count or a read in update-time order "
"failed, or Assets you cannot see sit exactly at the cutoff (the note gives the range).",
not_permitted="You are not permitted to read the Assets.",
not_applicable=_always_applies("Finding stale assets"),
nothing_found="Checked: every Asset read was updated within the threshold, or there are no Assets.",
nothing_found="Counted: every Asset was updated within the threshold, or there are no Assets.",
),
out=[
_field("staleCount", "Stale Assets", "int", unit="Assets"),
Expand Down
Loading
Loading