Skip to content

feat(report-specs): RS-EGERIA-TIER stage 2, the seed - #569

Merged
dwolfson merged 3 commits into
odpi:mainfrom
dwolfson:feat/rs-stage2-seed
Nov 9, 2026
Merged

dwolfson merged 3 commits into
odpi:mainfrom
dwolfson:feat/rs-stage2-seed

Conversation

@dwolfson

@dwolfson dwolfson commented Nov 9, 2026 •

Copy link
Copy Markdown
Member

RS-EGERIA-TIER stage 2: the seed (the builtin tier loads from packaged JSON)

Branch dwolfson:feat/rs-stage2-seed, three signed commits (4b00da3f the seed, c55e5832 local overrides built-in, 998bb3e5 shadowing any
built-in documented),
on upstream/main 259ca15c (release 6.2.28). Ships in 6.2.29 (docs/release-notes/6.2.29.md).
Brief: BRIEF-RS-EGERIA-TIER-STAGE2-SEED-2026-11-09.md. Design: report-spec pipeline model v5.5, §7a "Built-in
migration" and "Delivery stages" 2, §8f. Owner decisions S2-1 and S2-2 (2026-11-09) are applied, and so is the owner's answer to finding (a): "Yes, local
overrides" (2026-11-09), and to the follow-up on the bootstrap core: "Allow and document" (2026-11-09).

There are no Egeria writes, no publishing (stage 3), and the Python constants are not deleted (stage 4).

What changes

  • The builtin tier is the seed.

    • get_report_registry() loads the builtin tier from pyegeria/view/seed/: one JSON file per family (38) plus
      manifest.json.
    • It loads through seed_report_specs(), lazily, once per process.
    • Each entry is {label, envelope, microflow}, and it is converted by microflow_to_format_set, the same
      converter the EGERIA tier uses.
    • The manifest holds the seed format, the files with their counts, the label order and the census.
  • The seed holds 437 specs (S2-2).

    • These are base_report_specs (107), generated_format_sets (304), the analytic demos (23) and the question
      specs Questions, Report-Types and Question-Specs (3).
    • The analytic_demos entry point is removed from pyproject.toml.
    • The import-time RUNTIME registration of the question specs is removed.
  • microflow/1 additions. The schema file, the MicroflowV1 parser and both converters change together.

    • Format-only specs (S2-1): "stages": [] is valid only with no params and at least one formatter. The
      resulting FormatSet has no action.
    • additional_props: an optional key on a find stage that carries FormatSet.get_additional_props.
      • It may name only a function on ADDITIONAL_PROPS_HOOKS. The 5 hook specs name 3 distinct functions:
        _client_extract_element_properties_for_keyword, CollectionManager._extract_digital_product_properties
        and CollectionManager._extract_agreement_properties.
      • check_allowlist refuses any other name, or the key on a non-find stage. microflow_to_format_set refuses it
        too, so even a caller that skips the allowlist cannot load it.
    • same_as: a formatter key meaning "this output format shares the formatter of an earlier one".
      • A Format with several types is written once, under its first type, and the other types get same_as.
        The loaded FormatSet groups them back into one Format.
      • Without it, 65 specs came back with their formats split per type. That leaks into the types list that
        select_report_format returns.
      • It also keeps the seed small. When one output type is listed by two Formats, the writer now raises instead
        of dropping the second one silently.
  • The generator.

    • python -m pyegeria.view.seed build writes the seed from the constants.
    • python -m pyegeria.view.seed check exits 1 when the seed is stale. A micro-test runs the check.
    • refresh_specs runs build after it regenerates the report specs (new step 3b).
  • Words. A seed file that fails to parse or validate is skipped with a warning naming the file and its first
    error, and the other files still load.

    • With no usable manifest, every file loads in name order.
    • If a label appears in two files, the later file is skipped.
  • BOOTSTRAP_CORE is defined but has no run-time effect in stage 2. It holds:

    • Referenceable, Default and Journal-Entry-DrE;
    • the three question specs;
    • Report-Specs and the Report-Spec-/Report-Type-DrE specs;
    • every Dr.Egeria display spec, i.e. any label ending in -DrE, -DrE-Basic or -DrE-Advanced.

    That makes 315 labels in all, and a micro-test checks that each one exists in the seed.

  • report_spec_source() for a builtin spec now adds "seed": "<file>", for example
    {"tier": "builtin", "label": "Search-Keywords", "version": None, "seed": "Feedback Manager.json"}.

  • Packaging. view/seed/*.json is added to package-data and to MANIFEST.in.

  • Precedence: local > egeria > builtin (owner, 2026-11-09: "Yes, local overrides"; commit c55e5832).

    • A local spec with a built-in's label now wins, with one warning per label per process, worded as for an
      Egeria-held copy. A local spec is a user-directory file, an entry point, or register_report_specs().
      The warning reads: Report spec 'Questions': the local copy shadows the builtin copy (they are the same); the builtin copy stays addressable as 'builtin:Questions'.
    • builtin:<label> still reaches the built-in, and list_report_specs(with_status=True) lists it under that
      address with shadowed_by: local.
    • refresh_report_specs() skips a CONFIG entry only for a clash with a RUNTIME label, no longer for a built-in's
      label. register_report_specs() raises only for another local source's label.
    • Aliases follow stage 1's rule. A local alias that a built-in or Egeria-held spec holds as its label or alias
      is dropped from the local copy, with one warning. A local copy keeps the aliases of the spec it shadows.
    • With no local spec, the registry is exactly the seed.
    • Docs: the registry tiers and precedence in docs/output-formats-and-report-specs.md, plus
      docs/release-notes/6.2.29.md.
  • A local spec may shadow ANY built-in (owner, 2026-11-09: "Allow and document"; commit 998bb3e5).

    • That includes the bootstrap core and the Dr.Egeria display specs (for example Glossary-DrE-Basic). It changes
      what Dr.Egeria and the Portal show for that label; builtin:<label> still reaches the original, and the shadow
      is logged once per label. No code change was needed: c55e5832 already allowed it. The commit documents it
      (precedence and tier section of the docs, and the 6.2.29 note) and pins it with a test.
    • Architect's P3: _report_spec_entry_points() skips a stale analytic_demos entry point (matched by name
      AND value, pyegeria.view.analytic_demo_specs:get_analytic_demo_specs, so another package's entry point of the
      same name still loads) with one log line per process telling the user to reinstall. A stale editable install
      no longer loads the demos a second time as local specs.

Gates (brief §3)

Gate Result
1. Model equality, all 437 437 of 437 identical: seed_report_specs()[label].model_dump() == constant.model_dump(). This covers the envelope, the action, get_additional_props (the 5 hook specs), question_spec, every Format with its grouping, and every column field. The 61 format-only specs are included. Label order is identical too.
2. Census vs the 6.2.28 base (measured at 259ca15) Base: 437 / 376 runnable / 0 unrunnable / 61 format-only, 352 find + 24 analytic, 38 families. Branch: identical, with the same label set and the same single warning (Valid-Values check 2). The only difference is the tier split: base builtin 411, local 26; branch builtin 437. That is S2-2.
3. Output byte-identical Offline, the whole census: select_report_format(label, type) for every spec × 12 output types plus every declared type plus 2 aliases each, and list_report_specs(with_status=True) (with source excluded, since it is the S2-2 change), and report_spec_list(). That is 5,679 outputs, all sha256-identical between a 6.2.28 wheel and the branch wheel, each in a clean venv. Live sample against qs-view-server: NOT RUN by the builder (see "Not done").
4. Allowlist 0 of 437 refused: every seed micro-flow passes check_allowlist. All 437 also validate against schemas/microflow-1.json (a micro-test).
5. Import cost import pyegeria plus the first get_report_registry(), median of 5, over several rounds: base ~0.42 s, branch ~0.45 s, about +7 %. The first cut measured +21–27 %; sharing identical Column objects during the seed load fixed it (15,475 columns, 642 distinct; the constants already share theirs, and nothing changes a Column after it is built).
6. Not stale seed check runs in the micro-tests (test_seed_is_not_stale).
7. Wheel The wheel built from the branch holds the 38 family files and manifest.json, and has no pyegeria.report_specs entry point. Installed into a clean 3.13 venv and run with python -I outside the source tree: census 437 / 376 / 0 / 61, labels and warnings identical to the base, and seed check reports the seed current.
8. Scratch elements excluded No E-Collections* label is in the seed (a micro-test). The seed is built from the constants only, never from Egeria.

Micro-tests (uv run -p 3.13 pytest tests/micro-tests/ --junitxml …, counts from the JUnit XML):

  • at 4b00da3f: 2,532 tests, 0 failures, 0 errors, 3 skipped (2 library-mirror collection skips, 1 live-only);
  • at c55e5832: 2,539 tests, 0 failures, 0 errors, 3 skipped. The run was on 3a8c7904; the amend to c55e5832
    added only the release-note reinstall line (docs/release-notes/6.2.29.md, +3/−2);
  • at 998bb3e5: 2,544 tests, 0 failures, 0 errors, 3 skipped (run on the exact tree committed).

New: tests/micro-tests/test_rs_egeria_tier_seed.py (38 tests). It includes the precedence tests the owner's decision
asked for:

  • a user-directory copy of Questions (one of the 26 former-local specs) and a runtime copy of Referenceable (a
    bootstrap-core built-in) each win with exactly one warning over three registry builds;
  • builtin: addressing;
  • the census unchanged with an empty user directory;
  • the alias rule;
  • a user-directory copy of each of Default, Report-Spec-DrE-Basic, Report-Types and Glossary-DrE-Basic
    (bootstrap core and Dr.Egeria display specs) wins, is what select_report_format returns, warns exactly once,
    and leaves builtin:<label> reaching the seed's object;
  • a stale analytic_demos entry point is skipped with one log line, and a same-named entry point from another
    package is not.

Changed:

  • 4 existing tests that asserted the old tiers, the old spec_source keys or the old entry point;
  • 3 that asserted that a built-in's label clashes. Each now asserts the override, plus a kept clash test against a
    RUNTIME label.

Behaviour changes for the release note

  1. The 23 analytic demo specs and Questions, Report-Types and Question-Specs move from tier local to
    builtin (S2-2).
    list_report_specs(with_status=True) reports source: "builtin" for them, and
    spec_source.tier is builtin.
  2. pyegeria no longer declares the analytic_demos entry point. An existing editable install keeps the old
    entry-point metadata until it is reinstalled. Until then a refresh skips that stale entry point by name, with
    one log line (since 998bb3e5). If you installed pyegeria from a checkout (editable), reinstall it so the removed
    analytic_demos entry point drops out of the installed metadata.
    The Coordinator's gate of 4b00da3f hit this
    before the skip existed: 10 failures in a stale venv, fixed by a reinstall.
  3. A local spec overrides a built-in of the same label (local > egeria > builtin), with one warning. Before, a
    user-directory or entry-point spec was skipped and a runtime registration raised ReportFormatCollision. This
    includes the bootstrap core and the Dr.Egeria display specs ("Allow and document"): shadowing one changes what
    Dr.Egeria and the Portal show for that label.
  4. spec_source for a builtin spec gains "seed": "<file>".
  5. microflow/1 accepts "stages": [], additional_props and same_as (above). An older pyegeria refuses a spec
    that uses them. That only matters once stage 3 publishes such specs to Egeria.

Findings and deviations from the brief (for the read-back)

  • (a) Precedence: RESOLVED by the owner. At 4b00da3f, the brief's "a local spec overrides them" did not hold.
    refresh_report_specs() and register_report_specs() rejected any built-in label, as they had since before this
    PR. The owner's answer was "Yes, local overrides", and c55e5832 implements it for every built-in (above).

  • Envelope key target_type_name, not target_type. The brief's entry shape says target_type, but the EGERIA
    tier's cache envelope and _load_dir read target_type_name (Egeria's targetTypeName). I followed "the envelope
    matches the fields the EGERIA tier reads". question_spec is in the envelope as the brief says. The EGERIA tier
    does not read it yet.

  • ADDITIONAL_PROPS_HOOKS holds 3 names, not 5. There are 5 specs but 3 distinct functions; the brief's
    "today's 5 function names" counts specs.

  • The dr-egeria-command-sync skill is not in this repo. It lives in ~/.claude/skills/ and is not
    version-controlled, so "update the skill's steps in the same PR" cannot be done in the PR. The proposed text is in
    the side-session notes (SKILL-UPDATE-rs-stage2-seed.md) to apply when this merges. Applying it now would tell
    other sessions to run a command that does not exist on main.

  • Still read from the constants (stage 4 removes them):

    • the legacy report_specs dict and its helpers (get_report_spec_heading, get_report_spec_description, the
      get_report_spec_match heading fallback);
    • microflow._column_catalog (used only for bare string column keys, which the seed never writes);
    • commands/generate_question_spec_markdown.py and commands/migrate_question_specs.py.

    None of them changes output, because the seed equals the constants (gate 1).

  • analytic_demo_specs.register_analytic_demo_specs() has no callers. After c55e5832 calling it no longer raises.
    It registers local copies that shadow the seed's identical copies, with one warning each.

  • Seed size: 1.8 MB in 33,487 lines. Every leaf object (a column or a parameter) is on one line, so a diff shows
    changes column by column. base_report_formats.py is 1.37 MB.

Not done

  • Gate 3 live sample: not run. I could not read the live credentials from this session, because the
    permission classifier blocked looking for an .env. The offline proof above covers every spec × format at the
    selection layer, and the rendering code is unchanged. The brief's read-back (§4) has the Architect run the live
    sample anyway: at least 12 specs × their formats, including Search-Keywords, an analytic demo, Questions and a
    detail_spec spec.
  • Library 0.4.0 (438) census: not run, because the library is not installed in this worktree.

🤖 Generated with Claude Code

…om packaged JSON)

The builtin tier now loads from packaged JSON (pyegeria/view/seed: one file per
family plus manifest.json) through seed_report_specs(), once per process, via
the same microflow_to_format_set converter the EGERIA tier uses. The Python
constants stay only as the generator's input until stage 4.

- Seed holds 437 specs (S2-2): base_report_specs, generated_format_sets, the 23
  analytic demos and the 3 question specs. The 26 move from tier local to
  builtin; the analytic_demos entry point and the import-time RUNTIME
  registration of the question specs are removed.
- microflow/1: format-only specs have "stages": [] with no params and at least
  one formatter (S2-1); a find stage's "additional_props" carries
  get_additional_props, limited to ADDITIONAL_PROPS_HOOKS and checked by the
  allowlist; a formatter's "same_as" keeps a Format with several types as one.
  Schema, parser and both converters updated together.
- python -m pyegeria.view.seed build|check; refresh_specs runs build; a
  micro-test fails when the seed is stale. BOOTSTRAP_CORE named (no run-time
  effect yet). A bad seed file is skipped with words; the rest still load.
- report_spec_source() names the seed file for a builtin spec.

Every seed spec equals its constant-defined FormatSet (model_dump, 437/437);
census unchanged: 437 / 376 runnable / 0 unrunnable / 61 format-only.

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

Owner decision 2026-11-09 ("Yes, local overrides"): a local report spec (user
specs dir, entry point, or register_report_specs) with a built-in's label now
wins, with one warning per label per process worded like the EGERIA-tier
shadow warning. builtin:<label> still reaches the built-in, and
list_report_specs(with_status=True) lists it under that address.

- refresh_report_specs no longer skips a CONFIG entry for a built-in label;
  a clash with a RUNTIME label is still skipped.
- register_report_specs no longer raises for a built-in label; another local
  source's label still raises.
- Aliases follow stage 1's rule: a local alias that a built-in or Egeria-held
  spec holds is dropped from the local copy, with one warning; a local copy
  keeps the aliases of the spec it shadows.
- With no local spec the registry is exactly the seed (census unchanged).

Docs: the registry tiers and precedence in output-formats-and-report-specs.md,
and docs/release-notes/6.2.29.md (the seed ships in 6.2.29).

Signed-off-by: Dan Wolfson <dan.wolfson@pdr-associates.com>
@dwolfson
dwolfson marked this pull request as ready for review November 9, 2026 16:36
…e analytic_demos entry point

Owner, 2026-11-09: "Allow and document". A local spec may shadow any
built-in, including the bootstrap core and the Dr.Egeria display specs
(e.g. Glossary-DrE-Basic). That changes what Dr.Egeria and the Portal show
for that label; builtin:<label> still reaches the original, and the shadow
is logged once per label. Documented in the precedence/tier section and
the 6.2.29 note; pinned by a parametrized test over four core labels.

Architect's P3: _report_spec_entry_points() skips the removed analytic_demos
entry point (matched by name and value) left in a stale editable install's
metadata, with one log line per process, instead of loading the demos a
second time as local specs.

Signed-off-by: Dan Wolfson <dan.wolfson@pdr-associates.com>
@dwolfson
dwolfson merged commit 690cbb7 into odpi:main Nov 9, 2026
6 checks passed
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