diff --git a/MANIFEST.in b/MANIFEST.in index e2c39222..e28dcfce 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -3,4 +3,6 @@ recursive-include md_processing/data *.json *.py recursive-include md_processing/md_commands *.py recursive-include md_processing/md_processing_utils/tests *.csv *.md *.txt - recursive-include tests *.py *.ini *.ipynb *.md *.txt \ No newline at end of file + recursive-include tests *.py *.ini *.ipynb *.md *.txt + recursive-include pyegeria/view/schemas *.json + recursive-include pyegeria/view/seed *.json diff --git a/commands/tech/refresh_specs.py b/commands/tech/refresh_specs.py index ee958244..f81ac0c8 100644 --- a/commands/tech/refresh_specs.py +++ b/commands/tech/refresh_specs.py @@ -9,6 +9,7 @@ 1. Markdown command templates generation (generate_md_cmd_templates) 2. Dr. Egeria help documentation generation (generate_dr_help) 3. Report FormatSet specifications generation (gen_report_specs) +4. The report-spec seed (python -m pyegeria.view.seed build), which the builtin tier loads Usage: uv run python refresh_specs.py [options] @@ -99,6 +100,11 @@ def main(): run_command(cmd_reports, "Report Specifications Generation") + # 3b. Rebuild the report-spec seed (RS-EGERIA-TIER stage 2): the builtin tier loads from the packaged + # JSON in pyegeria/view/seed, generated from the Python constants. A fresh process, so it reads the + # generated section just written. Until stage 4 the constants stay the source. + run_command([python_exec, "-m", "pyegeria.view.seed", "build"], "Report Spec Seed Build") + # 4. Resolve every report spec (RS-W2-2 PR-B, note §2c) and say which cannot run, and why. # Imported here, after the generation subprocess, so the freshly written specs are the ones read. from pyegeria.view.spec_resolver import log_resolution_summary diff --git a/docs/output-formats-and-report-specs.md b/docs/output-formats-and-report-specs.md index fc281f36..9159aad5 100644 --- a/docs/output-formats-and-report-specs.md +++ b/docs/output-formats-and-report-specs.md @@ -522,14 +522,37 @@ You can add report specs without changing pyegeria’s source. List them in conf ### Where pyegeria looks for user specs -Every report-spec lookup (`select_report_spec`, `get_report_spec_match`, `list_report_specs`, `hey_egeria`, Dr.Egeria, Egeria Explorer) goes through `get_report_registry()` in `pyegeria/view/base_report_formats.py`. It merges four tiers: +Every report-spec lookup (`select_report_spec`, `get_report_spec_match`, `list_report_specs`, `hey_egeria`, Dr.Egeria, Egeria Explorer) goes through `get_report_registry()` in `pyegeria/view/base_report_formats.py`. It merges three tiers, and +**a label held by a higher tier shadows the lower one: local > egeria > builtin** (6.2.29): | Tier | Source | |---|---| -| `BUILTINS` | `base_report_specs`, hand-maintained in `base_report_formats.py` | -| `GENERATED` | `generated_format_sets`, written by `refresh_specs` | -| `CONFIG` | Installed packages' entry points and your JSON files (below) | -| `RUNTIME` | Anything registered in code with `register_report_specs(...)`; survives `refresh_report_specs()` | +| `builtin` | **The seed** (6.2.29): pyegeria's shipped specs as packaged JSON in `pyegeria/view/seed/`, one file per family plus `manifest.json`. It holds the hand-maintained built-ins (`base_report_specs`), the generated Dr.Egeria specs (`generated_format_sets`, written by `refresh_specs`), the analytic demo specs and the question specs. The seed is generated from those Python constants by `python -m pyegeria.view.seed build` (which `refresh_specs` runs); `... seed check` fails when it is stale. Never edit it by hand. | +| `egeria` | Report specs held in Egeria, synced into a local cache (RS-EGERIA-TIER) | +| local: `CONFIG` | Installed packages' entry points and your JSON files (below) | +| local: `RUNTIME` | Anything registered in code with `register_report_specs(...)`; survives `refresh_report_specs()` | + +**Overriding a built-in (6.2.29).** A local spec (a user-directory file, an entry point, or a runtime +registration) with a built-in's or an Egeria-held spec's label **wins**, with one warning per label per process: + +``` +Report spec 'Questions': the local copy shadows the builtin copy (they are the same); the builtin copy stays addressable as 'builtin:Questions'. +``` + +`builtin: