Skip to content

feat(view): Egeria-held spec safety follow-ups (allowlist, binder warning, Asset-Graph, Data-Classes) - #564

Merged
dwolfson merged 6 commits into
odpi:mainfrom
dwolfson:fix/egeria-held-binder-warning
Nov 9, 2026
Merged

dwolfson merged 6 commits into
odpi:mainfrom
dwolfson:fix/egeria-held-binder-warning

Conversation

@dwolfson

@dwolfson dwolfson commented Nov 9, 2026

Copy link
Copy Markdown
Member

Egeria-held spec safety follow-ups

Branch fix/egeria-held-binder-warning at 9b0fffe, based on upstream/main 0fdf951 (#563 and #561). It has six signed commits:

  1. d5b99a44: a spec held in Egeria now warns about analytic_binders the same way a local spec does (O1-a).
  2. d39a0dec: a positive allowlist of find methods for specs held in Egeria.
  3. e2e8a8c8: the two built-in specs that could not run (Asset-Graph, Data-Classes) are repointed, so the census has none left.
  4. 883d33e4: Asset-Graph renders the graph in every format it declares (the Architect's P2 on commit 3).
  5. 5fbc3c44: Asset-Graph as an edge table, with a shape per output format. Superseded by commit 6.
  6. 9b0fffef: Asset-Graph declares DICT and JSON for code, and REPORT, HTML and MERMAID for people. The edge table is planned as its own Wave 3 spec (the Architect's choice, which the owner accepted).

Commits 1 and 2 come from the Architect's read-back of RS-EGERIA-TIER stage 1 (#563). Commit 3 is the owner's fix. All three are pulled forward so that pyegeria 6.2.28, the first release with the EGERIA tier, ships with them.

1. A binder on a spec held in Egeria warns like a local one (O1-a)

Problem: a stage's analytic_binders key on a spec held in Egeria ended up only as a general note, "carries key(s) this pyegeria does not read: …; ignored". So #561's resolver warning (BINDERS_DEPRECATED_PREFIX, "deprecated: analytic_binders ignored") never fired for specs held in Egeria, which is the very case it was written for.

Fix:

  • microflow_to_format_set passes a stage's analytic_binders on to the action. From there it follows the same path as a local spec:
    • the PR-B ActionParameter shim drops the key, raises its DeprecationWarning and records the binder names;
    • the resolver then warns with BINDERS_DEPRECATED_PREFIX.
  • An empty binder stays silent.
  • Other unknown stage keys are still recorded as notes.
  • This works for format 0 and for microflow/1, and on every tier load, because the tier rebuilds each spec from the cached micro-flow text, which keeps the key.
  • PR-0 P3: the shim's docstring now says the _dropped_binders record survives model_copy but not model_dump followed by a reload.

2. A positive allowlist of find methods

Problem: a find method was allowed if its name started with find_, get_ or list_. That prefix does not prove a method only reads: AutomatedCuration.get_create_csv_data_file_element_from_template creates an element.

Fix: that rule is replaced by a named, positive list.

  • FIND_METHOD_ALLOWLIST is the union of two parts:

    • _CENSUS_FIND_METHODS: the 45 find methods that runnable built-in specs name, taken from the 437-spec census. The two unrunnable specs' methods do not exist, so they are left out.
    • FIND_METHOD_ADDITIONS: reviewed additions. It is empty for now.

    A spec held in Egeria may name an entry exactly as written, Class.method, or its _async_ twin. Anything else is refused with words, whatever its prefix. That includes the same method spelled through another class, such as EgeriaTech.find_collections.

  • FIND_METHOD_DENYLIST is kept as a second, independent check:

    • it is checked first;
    • it denies a method on any class;
    • a test fails if it overlaps the allowlist.
  • The write-word scan now runs over the allowlist itself. For each entry it checks the method name, plus the first docstring line of both the sync method and its _async_ twin. Reviewed reads are now keyed by Class.method, as the Architect asked in note (a) on 224f189. Two entries are reviewed:

    • DataDiscovery.get_security_posture_history matched "test run";
    • ServerClient.get_attached_comments matched "attached".
  • New coverage test: every runnable built-in or generated spec's function must be on the allowlist, so the stage-2 seed (today's built-in specs written into Egeria) can never be refused.

  • Other new tests:

    • every entry resolves to a method that exists;
    • an _async_ twin is allowed;
    • a method that reads but is not listed (CollectionManager.get_collection_by_guid) is refused.
  • microflow-1.json and the module docstring now describe the allowlist.

3. The two built-in specs that could not run now run (the owner's fix)

  • Asset-Graph: it named ServerClient.get_asset_graph, which no longer exists.
    • It now calls AssetCatalog.get_asset_graph_by_guid.
    • The required parameter is now guid (it was asset_guid), and start_from and page_size are optional.
    • The hey_egeria asset graph command (commands/cat/get_asset_graph.py) now passes guid.
  • Data-Classes: it named DataDesigner.find_data_classes, which no longer exists.
    • It now calls DataDesigner.find_data_value_specifications with spec_params={"metadata_element_subtypes": ["DataClass"]}.
    • DataClass is a subtype of DataValueSpecification and shares its search endpoint. The filter goes through **kwargs into _async_find_request and travels in the search body as metadataElementSubtypeNames.
    • The two subtype keys are removed from the spec's optional parameters, so a caller cannot override the filter.
  • Read-only live check against qs-view-server:
    • Filtering on the DataClass subtype returns the 6 DataClass elements. Filtering on DataGrain returns none, so Egeria applies the filter.
    • Data-Classes DICT returns 6 DataClass rows. It fills the same columns as Data-Value-Spec does on the same data; this data does not set Data Type or Specification.
    • Asset-Graph runs in DICT and MERMAID on a real asset guid.
  • Allowlist: AssetCatalog.get_asset_graph_by_guid is added to the allowlist, which now has 46 entries. find_data_value_specifications was already on it, and the "every runnable built-in spec is on the list" test now covers both specs.
  • Census: 437 specs, of which 376 are runnable, 61 are format-only and 0 cannot run. It was 374, 61 and 2.
    • The resolver tests that used Data-Classes as their example of a spec that cannot run now use a test spec instead.
    • KNOWN_UNRUNNABLE is now empty.
    • The log_lines fixture now turns the pyegeria logger back on, because another test module can leave it off.
  • Docs: the census numbers in docs/output-formats-and-report-specs.md are updated, and the two "unrunnable today" examples are now history, with the fix that cleared them. New docs/release-notes/6.2.28.md.

4. Asset-Graph renders the graph in every format it declares

This fixes the Architect's P2 on e2e8a8c: the spec ran, but its output was not the graph.

What was really wrong, checked live and against a recorded response:

  • The anchor graph's column key was misspelled, anchorMermaidGRaph, so Anchor Graph was always empty. It is now anchorMermaidGraph. An Action Graph column is added for actionMermaidGraph, which the response also carries.
  • The spec declared only ALL. Asking for ALL as the output format returned a markdown string of 62 to 82 characters holding only the asset's name, labelled kind json.
  • MD and FORM rendered a Dr.Egeria "Update Asset" form, and LIST rendered a markdown table. None of these can show a graph.

Two findings in the read-back did not reproduce:

  • REPORT and MERMAID were never empty. Text results come back as kind text with the output in content, and data is not used. The read-back read data.
  • DICT's single row is the asset itself. On this repository, the first result of find_assets is a GovernanceActionProcessInstance, and its display name reads like an audit message. Run live on four asset types, DICT returned one row each time, and that row was the asset.

The fix:

  • Asset-Graph now declares these formats:
    • DICT, TABLE and JSON: the asset's own fields, plus the graphs as text.
    • REPORT and HTML: the asset's fields, with the asset, anchor and action graphs rendered as mermaid.
    • MERMAID: the asset graph.
  • The columns are now a named constant, ASSET_GRAPH_COLUMNS.
  • ALL, MD, FORM and LIST are dropped, and a code comment says why. Asking for one of them now raises the executor's existing error, which lists the formats the spec does declare.
  • format_set_executor: a ValueError from the find path used to be printed and swallowed, so the call returned None. It is now logged and raised again.

Tests: 17 new tests in tests/micro-tests/test_asset_graph_spec.py.

  • They use a recorded get_asset_graph_by_guid response, tests/micro-tests/data/asset_graph_by_guid_response.json. It was recorded read-only from qs-view-server, with relationships trimmed.
  • They run the real path from exec_report_spec down to _generate_asset_output. Only the HTTP request is replaced. A guard fails the test if a real client would be built.
  • They cover:
    • every declared format;
    • DICT is one row, the asset, with all three graphs;
    • REPORT has three mermaid blocks;
    • MERMAID equals the rendered mermaidGraph;
    • ALL, MD, FORM and LIST raise with words;
    • no declared format returns None.

Read-only live check against qs-view-server, after the fix:

  • DICT is one row, with the graphs at 740 characters (mermaid), 878 (anchor) and 804 (action).
  • REPORT has three mermaid blocks. HTML and MERMAID carry the graph.
  • ALL and MD raise with words.
  • On Notification, EngineAction and ConnectorActivityReport assets, DICT is one row and it is the asset.

The 6.2.28 release note now covers the Asset-Graph change, without "output incomplete" wording, since every declared format works.

5. Asset-Graph as an edge table (superseded by commit 6)

Commit 5 turned DICT and TABLE into one row per edge and gave each format its own shape, following the owner's question "What does it mean for a Table to return a graph?". The Architect then proposed a narrower spec, and the owner said "we can take the architect's choice". Commit 6 applies that choice. Two pieces of commit 5 are kept:

  • The edge and node helpers: pyegeria/view/asset_graph.py, which the Wave 3 edge-table spec will use.
  • Markdown tables in HTML: GFM tables are enabled in markdown_to_html, because the CommonMark preset had them off although the page's CSS already styles tables.

6. Asset-Graph: DICT and JSON for code; REPORT, HTML and MERMAID for people

What each declared format returns:

Format Shape
DICT One row: the asset itself, with its own fields and its graph fields as text.
JSON The full graph response.
REPORT, HTML The asset's fields, with the asset, anchor and action graphs rendered as mermaid.
MERMAID The asset graph.

This matches what 883d33e returned for these formats, apart from the P3 fix below.

What is not declared: TABLE, LIST, MD, FORM and ALL. Asking for any of them raises an error that names the declared formats.

  • Normally a TABLE request falls back to the spec's DICT format. A new named set, NO_TABLE_FALLBACK in base_report_formats.py, turns that fallback off for Asset-Graph only, matching the label with or without a tier prefix. Every other spec keeps the fallback.
  • A table of a graph is its edges. That edge table is planned as its own spec in Wave 3, built by a processor stage.

The Architect's P3 is kept: a REPORT names a search string only when one was given.

  • get_asset_graph_by_guid's output passes no search string.
  • generate_output remembers whether the caller searched before it fills in "All".
  • The REPORT preamble prints "found from the search string" only for a real search, and HTML passes the original search string on to its REPORT render.
  • A find with no search string also no longer says "found from the search string: All".

What is removed: the edge and node shapes in asset_graph.py, and the generator that applied them. AssetCatalog's _generate_asset_graph_output now just calls the generic asset output with no search string. asset_graph.py keeps only graph_edges and graph_nodes, as helpers for the Wave 3 spec. No spec uses them, and they are tested directly rather than through a spec.

Tests: tests/micro-tests/test_asset_graph_spec.py covers each declared format against the complete recording:

  • DICT is one row, the asset, with all three graphs;
  • JSON is the full response;
  • REPORT has three mermaid blocks and no search-string line;
  • HTML carries the graph and no search-string line;
  • MERMAID is the rendered mermaidGraph.

It also checks that:

  • TABLE, LIST, MD, FORM and ALL are refused with words;
  • Data-Structures, which declares DICT but not TABLE or ALL, still gets the TABLE→DICT fallback;
  • a REPORT from a real search still names its search string.

The helper tests check the 5 hand-read edges, a stable order when the response is shuffled, and the order of nodes by role.

Read-only live check against qs-view-server:

  • DICT is one row, the asset.
  • JSON is the full response.
  • REPORT has three mermaid blocks and no "search string".
  • HTML and MERMAID carry the graph.
  • TABLE and LIST are refused with words.

Note on hey_egeria: its asset-graph command still asks for TABLE. That keeps working, because the command's own list_generic maps TABLE to DICT before it calls the spec, so it shows the asset's one row as a terminal table. Moving that command to REPORT, or to the Wave 3 edge spec, is a follow-up.

Tests

The full micro-suite on Python 3.13 (uv run -p 3.13 pytest tests/micro-tests/, JUnit): 2417 tests, 0 failures, 0 errors, 3 skipped (run 12:58Z). For comparison:

  • 2417 after commit 5;
  • 2413 after commit 4;
  • 2396 after commit 3;
  • 2395 after commit 2;
  • 2389 after commit 1;
  • 2379 on upstream/main 0fdf951 (worked out by subtracting commit 1's 10 new tests, not run separately).

No Egeria calls were made.

🤖 Generated with Claude Code

…e does (O1-a)

Architect read-back P2 of RS-EGERIA-TIER stage 1 (odpi#563) against RS-W2-4 PR-0 (odpi#561):
a stage's analytic_binders key on a spec held in Egeria was recorded only as a
generic "ignored" note, so odpi#561's BINDERS_DEPRECATED_PREFIX warning never fired for
the very case owner decision O1-a was for.

- microflow_to_format_set now passes a stage's analytic_binders into the action. The
  PR-B ActionParameter shim drops it there, raises its DeprecationWarning and records
  the names, and the spec resolver warns with BINDERS_DEPRECATED_PREFIX, the same text
  as for a local spec. An empty binder stays silent; other unknown stage keys are
  still notes. Works for format 0 and microflow/1, and on every tier load, since the
  tier rebuilds from the cached micro-flow text, which keeps the key.
- PR-0 P3: the shim's docstring now says the marker survives model_copy but not
  model_dump and a reload.
- Tests: a synced Egeria-held spec (format 0 and microflow/1) with a non-empty binder
  resolves with exactly the odpi#561 warning; empty, None, [] and absent stay silent.

Signed-off-by: Dan Wolfson <dan.wolfson@pdr-associates.com>
The Architect's stage-2 allowlist items (read-back of RS-EGERIA-TIER stage 1, P2 and
note (a) on 224f189), pulled forward so pyegeria 6.2.28, the first release with the
EGERIA tier, ships them.

- The find_/get_/list_ prefix rule is gone. FIND_METHOD_ALLOWLIST is a positive list of
  Class.method entries (an _async_ twin is allowed too). It is _CENSUS_FIND_METHODS,
  the 45 find methods today's runnable built-in specs name (taken from the 437-spec
  census; the two unrunnable specs' missing methods are left out), plus
  FIND_METHOD_ADDITIONS, the reviewed additions, which is empty for now. A method not on it
  is refused with words, whatever its prefix.
- FIND_METHOD_DENYLIST is kept as a second, independent check: it is tested first, it
  denies on any class, and a test fails if the two lists overlap.
- The write-word scan now runs over the allowlist itself, on the name and on the first
  docstring line of both the sync method and its _async_ twin. The reviewed reads are
  keyed by Class.method: DataDiscovery.get_security_posture_history and
  ServerClient.get_attached_comments.
- New test: every runnable built-in or generated spec's function is on the list, so
  the stage-2 seed cannot be refused. Plus tests that every entry resolves, that an
  _async_ twin is allowed, and that same-method different-class spellings are refused.
- microflow-1.json and the module docstring describe the allowlist.

Signed-off-by: Dan Wolfson <dan.wolfson@pdr-associates.com>
…able

The owner's fix for the census's two unrunnable specs (pyegeria 6.2.28).

- Asset-Graph named ServerClient.get_asset_graph, which no longer exists. It now calls
  AssetCatalog.get_asset_graph_by_guid. The required parameter is now guid instead of
  asset_guid; the optional ones are start_from and page_size. commands/cat/
  get_asset_graph.py (the hey_egeria asset graph command) passes the new name.
- Data-Classes named DataDesigner.find_data_classes, which no longer exists. It now
  calls DataDesigner.find_data_value_specifications with
  spec_params={"metadata_element_subtypes": ["DataClass"]}. DataClass is a
  DataValueSpecification subtype that shares the same search endpoint, and the filter
  travels in the search body as metadataElementSubtypeNames (through **kwargs into
  _async_find_request). The two subtype keys are removed from the spec's optional
  params so a caller cannot override the filter.
- Live READ against qs-view-server (no writes):
  - The DataClass filter returns 6 DataClass elements; DataGrain returns none, so
    the filter is honoured.
  - Data-Classes DICT returns 6 DataClass rows. It fills the same columns as
    Data-Value-Spec does on the same data.
  - Asset-Graph DICT and MERMAID run on a real asset guid.
- AssetCatalog.get_asset_graph_by_guid is added to the positive allowlist (46
  entries). find_data_value_specifications was already on it. The every-runnable-
  built-in test now covers both specs.
- Census: 437 specs, 376 runnable, 61 format-only, 0 unrunnable (was 374 / 61 / 2).
  The resolver tests that used Data-Classes as their unrunnable example now register
  a probe spec. KNOWN_UNRUNNABLE is now empty. The log_lines fixture re-enables the
  pyegeria logger, because another module's test can leave it disabled.
- Docs: the census numbers in output-formats-and-report-specs.md are updated, and
  the two "unrunnable today" examples are now history with their fix. A new
  docs/release-notes/6.2.28.md is added.

Signed-off-by: Dan Wolfson <dan.wolfson@pdr-associates.com>
…lares

This fixes the Architect's P2 on e2e8a8c (READBACK-allowlist-specfix-cappedscans-2026-11-09 §2).
Asset-Graph resolved and ran, but its output was not the graph.

What was actually wrong, checked live and against a recorded response:
- The anchor graph column's key was misspelt `anchorMermaidGRaph`, so Anchor Graph was
  always empty. It is now `anchorMermaidGraph`, and an Action Graph column
  (`actionMermaidGraph`, which the response also carries) is added.
- The spec declared only ALL. Requesting ALL as an output format returned a 62-82 char
  markdown string holding just the asset's name, labelled kind "json".
- Requesting MD or FORM rendered a Dr.Egeria "Update Asset" form, and LIST a markdown table,
  none of which can show a graph.

Two read-back findings did not reproduce:
- REPORT and MERMAID were not empty. They return kind "text" with the graph in `content`
  (`data` is not used for text results). The read-back read `data`.
- DICT's single row is the asset itself. On this repository the first find_assets result is a
  GovernanceActionProcessInstance, whose display name reads like an audit message. DICT gave
  one row equal to the asset on four asset types live.

Changes:
- Asset-Graph declares DICT/TABLE/JSON, REPORT/HTML and MERMAID:
  - DICT, TABLE and JSON give the asset's own fields plus the graphs as text.
  - REPORT and HTML give the fields, with the asset, anchor and action graphs rendered as
    mermaid.
  - MERMAID gives the asset graph.
  - The columns are a named ASSET_GRAPH_COLUMNS list. ALL, MD, FORM and LIST are dropped, with
    the reason in a comment. Asking for one now raises the executor's existing error, which
    lists the declared formats.
- format_set_executor: a ValueError from the find path was printed and swallowed, so the call
  returned None. It is now logged and re-raised.
- Tests (17) against a recorded get_asset_graph_by_guid response
  (tests/micro-tests/data/asset_graph_by_guid_response.json, from qs-view-server, read only,
  relationships trimmed). They run the real path from exec_report_spec down to
  _generate_asset_output; only the HTTP request is replaced, and building a real client fails
  the test. They cover:
  - each declared format, with DICT a single row that is the asset and has all three graphs;
  - REPORT with three mermaid blocks;
  - MERMAID equal to the rendered mermaidGraph;
  - ALL, MD, FORM and LIST raising with words;
  - no declared format returning None.
- Live READ against qs-view-server, after the fix:
  - DICT is 1 row with Mermaid 740 / Anchor 878 / Action 804 characters.
  - REPORT has 3 mermaid blocks; HTML and MERMAID carry the graph.
  - ALL and MD raise with words.
  - DICT is one row, the asset itself, on Notification, EngineAction and
    ConnectorActivityReport assets.
- docs/release-notes/6.2.28.md is updated.

Signed-off-by: Dan Wolfson <dan.wolfson@pdr-associates.com>
The owner asked what it means for a table to return a graph: after 883d33e,
TABLE/DICT returned one row holding ~740 characters of mermaid text. The owner's
direction: "A table of edges and a different shape for other OutputTYpes".

New pyegeria/view/asset_graph.py (pure functions) gives each declared format a shape:
- DICT and TABLE: one row per edge, with From Display Name / From Type / From GUID /
  Relationship / To Display Name / To Type / To GUID.
  - The asset's own relationships (top-level lists such as governedBy and
    requestedActions) are included.
  - Direction comes from relatedElementAtEnd1 and startingElementGUID.
  - Each relationship is listed once, by relationship GUID.
  - Rows are sorted, so the order never depends on Egeria's. Paging stays Egeria's,
    on the graph request.
- LIST: the nodes (the asset, its anchored elements, the related elements), with
  their role.
- REPORT and MD: the asset summary, its graph(s) as mermaid, then the edge table.
  HTML renders that document.
- MERMAID: the graph.
- JSON: the full graph response.
- FORM and ALL are not declared, so asking for them is an error that names the
  declared formats.

Supporting changes:
- AssetCatalog._generate_asset_graph_output applies these shapes for
  get_asset_graph_by_guid. MERMAID and other formats take the generic asset path.
- The Architect's P3: a by-GUID REPORT no longer says "found from the search string".
- markdown_to_html now enables GFM tables. The CommonMark preset had them off, so
  markdown tables came out as plain text in HTML, although the page CSS styles tables.

Tests and checks:
- The tests use a complete recorded response, rewritten to cover each format, the
  hand-read expected edges (5, one reported twice), deterministic order under a
  shuffled response, the no-edge case, and the P3 wording.
- Live READ: edge rows equal the distinct relationship GUIDs on three asset types
  (5, 6 and 3), node counts are right, and REPORT never says "search string".
- The spec docs (output-formats-and-report-specs.md) and the 6.2.28 note record
  the shape per format.

Signed-off-by: Dan Wolfson <dan.wolfson@pdr-associates.com>
…AID for people

The Architect's choice, accepted by the owner. Supersedes the edge table
of 5fbc3c4.

- Asset-Graph no longer declares TABLE. A TABLE (or LIST, MD, FORM, ALL)
  request is refused with words naming the declared formats; a named
  NO_TABLE_FALLBACK set stops the generic TABLE->DICT fallback for this
  spec only.
- DICT is the asset itself with its graph fields; JSON is the full graph
  response; REPORT and HTML render the asset's fields and graphs; MERMAID
  is the graph.
- pyegeria/view/asset_graph.py is trimmed to the edge/node helpers kept
  for the Wave 3 edge-table spec; no spec uses them yet (tested directly).
- Keeps the P3 fix: a fetch by GUID no longer says "search string"; a
  search REPORT still names its search string.
- Tests, docs and the 6.2.28 note updated; the note says the edge table
  is planned as its own spec in Wave 3.

Signed-off-by: Dan Wolfson <dan.wolfson@pdr-associates.com>
@dwolfson
dwolfson merged commit 23349d4 into odpi:main Nov 9, 2026
6 checks passed
dwolfson added a commit to dwolfson/egeria-python that referenced this pull request Nov 9, 2026
Signed-off-by: Dan Wolfson <dan.wolfson@pdr-associates.com>

# Conflicts:
#	docs/release-notes/6.2.28.md
dwolfson added a commit to dwolfson/egeria-python that referenced this pull request Nov 9, 2026
Signed-off-by: Dan Wolfson <dan.wolfson@pdr-associates.com>

# Conflicts:
#	docs/release-notes/6.2.28.md
dwolfson added a commit to dwolfson/egeria-python that referenced this pull request Nov 9, 2026
…ilter-kwargs

Signed-off-by: Dan Wolfson <dan.wolfson@pdr-associates.com>

# Conflicts:
#	docs/release-notes/6.2.28.md
#	pyegeria/omvs/asset_catalog.py
#	pyegeria/view/format_set_executor.py
#	pyegeria/view/microflow.py
#	tests/micro-tests/test_rs_egeria_tier.py
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