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
72 changes: 72 additions & 0 deletions PYEGERIA_ISSUES.md
Original file line number Diff line number Diff line change
Expand Up @@ -1316,6 +1316,62 @@ changed beyond that one status correction and this note.

---

### ISSUE-118: the pyegeria wheel installed `my_egeria` one level too deep, so `my_egeria`, `my_profile`, `serve_my_egeria` and `serve_my_profile` failed in every pip install

**Layer:** Pyegeria (packaging) · **Status:** fixed 2026-10-02 · **Found:**
2026-10-02, preparing to serve the new My Profile app from the Egeria-Workspaces portal.

**What:** `[tool.setuptools.packages.find]` searched only from the repo root, so the
app's real package (`my_egeria/my_egeria/`, inside the `my_egeria/` uv workspace
member) shipped as `site-packages/my_egeria/my_egeria/...`. The four console scripts
point at `my_egeria.main`, `my_egeria.serve`, `my_egeria.DemoCode...`, and the app's
own code imports `from my_egeria.<module>`, so none of it resolved outside this repo's
dev venv (where the workspace member is installed editable). The portal survived only
because its own script launched `my_profile_app.py` by **file path**, found with a glob
for the nested layout.

**Fixed:** `where = [".", "my_egeria"]` with `namespaces = false`, so the inner
package installs as the top-level `my_egeria`. Two folders that had only shipped as
namespace packages (`pyegeria/config`, `commands/deprecated`) gained an
`__init__.py`. A clean-build comparison showed the wheel is otherwise identical: the
same 480 files, with `my_egeria/...` now top-level, plus the two new `__init__.py`.
`my_profile.tcss` now ships too, so the portal Dockerfile's manual copy is unnecessary.
**Downstream impact:** anything launching the app by the old nested file path must
switch to the entry points (`serve_my_profile` etc.).

**Related, same day:** `serve_my_egeria`/`serve_my_profile` shelled out to the
`textual serve` command, which comes from `textual-dev` (a dev-only dependency), so
they also failed in a plain install. They now use the `textual-serve` library
directly, and honour `MY_EGERIA_PUBLIC_URL`/`MY_PROFILE_PUBLIC_URL` for proxied
deployments.

---

### ISSUE-119: `exec_report_spec` silently dropped a caller's `graph_query_depth`, so report-spec calls always ran at depth 3

**Layer:** Pyegeria · **Status:** fixed 2026-10-02 · **Found:** 2026-10-02,
performance review of the My Profile and MyEgeria apps.

**What:** the synchronous `exec_report_spec` copies only a report spec's declared
`required_params`/`optional_params` into the call, and no spec declares
`graph_query_depth`. So `params={"search_string": "*", "graph_query_depth": 0}`
reached Egeria at the SDK default depth of 3, with no warning. The My Profile app asked for
depth 0 in about ten places and got none of it. Live, at the effective depth 3: the
13-glossary list and the root-collection list timed out at 90 s, the data
dictionaries took about 39 s and the product catalogue 42 s. At depth 0 they take
0.3–0.8 s. (The async path already forwarded it via `_merge_signature_params`.)

**Fixed:** `graph_query_depth` is now forwarded when the caller supplies it and the
target method accepts it (as a named parameter or `**kwargs`). This is deliberately narrower than the
async path, which forwards *every* caller param to `**kwargs` methods. Other
undeclared params are still not forwarded. Test:
`tests/micro-tests/test_exec_report_spec_graph_query_depth.py`. **Watch for:**
callers that asked for depth 0 but needed related elements were working only *because*
of this bug. My Profile's glossary folders and root-collection members were two such
cases, fixed in the same change by fetching the selected element at depth 1.

---

### ISSUE-116: `get_my_actors` always failed and `get_my_user_identities`/`get_my_roles` always returned nothing — same type-filter defect as ISSUE-115, hidden by tests that swallowed errors

**Layer:** Pyegeria · **Status:** fixed 2026-10-02 · **Found:** 2026-10-02
Expand Down Expand Up @@ -7972,6 +8028,22 @@ deployment-timing issue, not a code defect — see ISSUE-12, below.

## Not a bug / n/a

### ISSUE-120: Textual apps (My Profile, MyEgeria) crash on Python 3.14 with `assert task is not None` in `textual/rlock.py`

**Layer:** not pyegeria (Textual / Python 3.14) · **Status:** n/a, workaround: use
Python 3.13 · **Found:** 2026-10-02, testing the new My Profile app for the portal
image (`python:3.14-slim`).

**What:** Textual's `RLock.acquire` asserts `asyncio.current_task()` is not None,
which fails under Python 3.14. Reproduced with the new My Profile app on both Textual
6.1.0 (the portal's pin) and 8.2.8, the latest release, on 3.14. Both start cleanly on 3.13.
Textual's current `main` still has the same code. The older My Profile apparently
didn't reach that path; the new parallel profile loading does. The same failure is
noted in `.github/workflows/release.yml`, which pins CI to Python 3.13 for this reason.
**Action:** build Textual app images on Python 3.13; revisit when Textual supports 3.14.

---

### ISSUE-88: no `GovernanceZone` create or lookup anywhere in pyegeria — a zone can be *referenced* by every search and classification, but not made

**Layer:** Pyegeria · **Status: n/a — not a bug, corrected 2026-09-05 by dwolfson.**
Expand Down
2 changes: 2 additions & 0 deletions commands/deprecated/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
"""Package marker: ships this directory now that wheel package discovery
doesn't pick up namespace packages (see [tool.setuptools.packages.find])."""
38 changes: 36 additions & 2 deletions docs/developer_guide_pyegeria_textual.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ source .venv/bin/activate
**Using pyegeria in your own project** instead:

```bash
pip install pyegeria textual textual-dev
pip install pyegeria textual textual-dev # textual-dev only for the dev console and `textual run`
```

### Tell pyegeria where Egeria is
Expand Down Expand Up @@ -309,6 +309,37 @@ pyegeria has hundreds of methods. To explore them:
- The REST calls behind each method are recorded in `.http` files under
`pyegeria/http clients/`, which is useful when you need to see exactly what is sent.

### Ask only for the relationships you need: `graph_query_depth`

Every pyegeria `find_*`/`get_*` call sends a `graph_query_depth` that tells Egeria how many
levels of related elements to compute for each result. **The default is 3**, which is rich but
expensive, and the cost grows with the number of results. Measured on the quickstart server
while tuning the My Profile app:

| Call | Default depth (3) | Depth 0 |
|---|---|---|
| List of 13 glossaries | timed out at 90 s | 0.3 s |
| List of 100 collections (My Profile startup) | about 70 s | 0.6 s |
| Members of a 7-element collection | timed out at 30 s | 0.3 s |

Choose the depth from what your screen actually shows:

- **Lists and tables of names, descriptions, GUIDs** (header and properties only): use
**`graph_query_depth=0`**.
- **A detail view of one selected element that shows its related elements** (a glossary's
folders, a collection's members): fetch **just that element at depth 1** when it is
selected, rather than loading the whole list at depth 1.
- **Some views need more.** In My Profile, the profile's Teams, Communities and Projects and a
team's individual members disappear below depth 2.

Pass it as a keyword: `client.find_glossaries("*", graph_query_depth=0)`. Through
`exec_report_spec`, put it in `params` (`params={"search_string": "*", "graph_query_depth": 0}`);
this is forwarded to the method from pyegeria 6.1.26. Earlier versions silently dropped it.
A `params=` keyword on an SDK method itself is **not** a way to pass it: it is ignored.

To check a lower depth is safe, run the call at both depths with `output_format="JSON"` (or the
`DICT` your screen uses) and compare the fields your code reads.

---

## 6. Textual essentials (Steps 2 and 3)
Expand Down Expand Up @@ -960,8 +991,11 @@ python examples/developer_guide/capture_screenshots.py
- **Results are empty, or a column is missing.** The report spec doesn't define that column,
or `graph_query_depth` is too low for related data. Try `output_format="JSON"` to see
everything Egeria returned.
- **Slow responses or time-outs.** Use `graph_query_depth=0` unless you need relationships,
- **Slow responses or time-outs.** Use `graph_query_depth=0` unless you need relationships
(see [Ask only for the relationships you need](#ask-only-for-the-relationships-you-need-graph_query_depth)),
and `page_size` to limit how many results come back.
- **`assert task is not None` in `textual/rlock.py`.** You are on Python 3.14, which Textual
does not yet support. Use Python 3.13.
- **"Parameter ... is null" from Egeria when the parameter was set.** Your program is running
under a different Python than your venv. Check `which python` and `which textual`.
- **An action does nothing.** Check for two `@on` handlers with the same method name in one
Expand Down
8 changes: 6 additions & 2 deletions docs/my_profile_app_manual.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,16 +76,20 @@ my_profile # installed console script, runs from any directory
# or, from the app folder:
cd my_egeria/my_egeria/DemoCode/My_Profile
python my_profile_app.py
# or, with the Textual developer console available:
# or, with the Textual developer console (needs textual-dev, a dev dependency):
textual run --dev my_profile_app.py
```

Use Python 3.13: Textual currently fails on Python 3.14 (an assertion in `textual/rlock.py` at startup).

To serve the app in a web browser instead of a terminal:

```bash
serve_my_profile # textual serve on $MY_EGERIA_HOST:$MY_PROFILE_PORT (default 0.0.0.0:8020)
serve_my_profile # textual-serve on $MY_EGERIA_HOST:$MY_PROFILE_PORT (default 0.0.0.0:8020)
```

Behind a reverse proxy, set `MY_PROFILE_PUBLIC_URL` (or `MY_EGERIA_PUBLIC_URL`) to the URL browsers use, e.g. `https://localhost:8843/my-egeria`, so the page's asset and WebSocket URLs are same-origin.

## The Splash Screen and Changing User

When the app starts it shows a welcome card ("Welcome to My_Profile for Egeria Users, *user*!") while your profile loads from Egeria in the background.
Expand Down
16 changes: 10 additions & 6 deletions my_egeria/EGERIA_WORKSPACES_INTEGRATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,13 @@ to host my_egeria Textual apps as browser-accessible tools via the portal.

## How it works

`textual serve` turns any Textual app into a browser app — each WebSocket
`serve_my_profile` / `serve_my_egeria` use the `textual-serve` library (installed
with pyegeria) to turn the Textual app into a browser app — each WebSocket
connection gets its own isolated app instance. The portal button simply links
to the app's URL (new tab or iframe). No code difference between terminal and
browser modes; the same installed app serves both.
browser modes; the same installed app serves both. Behind a proxy, set
`MY_EGERIA_PUBLIC_URL` (or `MY_PROFILE_PUBLIC_URL`) to the URL browsers use, so
the page's asset and WebSocket URLs are same-origin.

---

Expand Down Expand Up @@ -89,7 +92,7 @@ prompts the user for credentials in the browser. No portal changes needed.

### Option B — Per-session process spawning (proper multi-user)
The portal's login flow calls a small management API that:
1. Spawns `textual serve --port <dynamic-port> serve_my_profile` with the
1. Spawns `serve_my_profile` with `MY_PROFILE_PORT=<dynamic-port>` and the
authenticated user's credentials as env vars.
2. Returns the URL to the portal, which opens it.
3. Cleans up (kills the process) on session logout / timeout.
Expand All @@ -115,7 +118,7 @@ location /my-profile/ {
}
```

The WebSocket upgrade headers are **required** — textual serve uses WebSockets.
The WebSocket upgrade headers are **required** — textual-serve uses WebSockets.

The portal button then links to `/my-profile/` instead of `localhost:8020`.

Expand Down Expand Up @@ -146,8 +149,9 @@ The compose service above uses `python:3.12-slim`. In practice, use a shared
base image that has `pyegeria` (and therefore `my_egeria`) already installed:

```dockerfile
FROM python:3.12-slim
RUN pip install pyegeria # installs my_egeria and all entry points
FROM python:3.13-slim # not 3.14: Textual fails on 3.14 (textual/rlock.py)
RUN pip install pyegeria # installs my_egeria, textual, textual-serve and all entry points
CMD ["serve_my_profile"]
```

Or reuse the existing `Dockerfile-jupyter` / `Dockerfile-egeria-platform`
Expand Down
32 changes: 24 additions & 8 deletions my_egeria/HANDOFF_egeria_workspaces_my_egeria.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,22 @@ lists only what is **new** and what egeria-workspaces must add/change.
| Listen port env | `MY_EGERIA_PORT` (default `8021`) |

Both entry points are installed by `pip install pyegeria` (no separate package).
`serve_my_egeria` runs `textual serve` against the app; each browser WebSocket
`serve_my_egeria` serves the app with the `textual-serve` library (a pyegeria
dependency — no `textual` CLI or `textual-dev` needed); each browser WebSocket
connection gets its own isolated app instance — no code difference between
terminal and browser modes.

**Requires a pyegeria release with the 2026-10 packaging fix.** Earlier wheels
installed the app one level too deep (`site-packages/my_egeria/my_egeria/...`), so
the `my_egeria`, `my_profile`, `serve_my_egeria` and `serve_my_profile` commands
failed in every pip install. The app now installs as the top-level `my_egeria`
package (`site-packages/my_egeria/...`). Anything that launched the app by **file
path** under the old nested layout must switch to the entry points.

**Use Python 3.13, not 3.14.** Textual (6.1.0 through the current 8.2.8) fails on
Python 3.14 with `assert task is not None` in `textual/rlock.py`; My Profile hits
it at startup. Build the image on `python:3.13-slim`.

### Port allocation (current)

| App | Port | Serve entry point |
Expand All @@ -42,8 +54,9 @@ terminal and browser modes.

The image used for the Textual app services must have a pyegeria build that
includes the `serve_my_egeria` entry point and the `my_egeria_app` module rename.
If the image pins an older pyegeria, bump it. No new dependencies were added
(`textual`, `textual-serve`, `textual-web` were already required).
If the image pins an older pyegeria, bump it. Do not pin an older `textual`;
let pyegeria's own dependency choose it. No extra packages are needed: `textual`
and `textual-serve` come with pyegeria.

### 2. Add a compose service (quickstart)

Expand Down Expand Up @@ -115,14 +128,16 @@ file. They must be present in the `my-egeria` service environment:
| `EGERIA_VIEW_SERVER` | `qs-view-server` | View server name |
| `EGERIA_USER` | `erinoverview` | Active persona (quickstart) |
| `EGERIA_USER_PASSWORD` | `secret` | Password (quickstart) |
| `MY_EGERIA_HOST` | `0.0.0.0` | Listen host for textual serve |
| `MY_EGERIA_PORT` | `8021` | Listen port for textual serve |
| `MY_EGERIA_HOST` | `0.0.0.0` | Listen host for textual-serve |
| `MY_EGERIA_PORT` | `8021` | Listen port for textual-serve |
| `MY_EGERIA_PUBLIC_URL` | `https://<site>/my-egeria` | URL browsers use when behind a proxy, so page and WebSocket URLs are same-origin. `MY_PROFILE_PUBLIC_URL` is the My Profile equivalent; `MY_EGERIA_PUBLIC_URL` is used for either app if the app's own is not set. |

---

## Verifying the hand-off

1. **Terminal:** `my_egeria` launches the TUI.
1. **Terminal:** `my_egeria` launches the TUI (the startup check now uses the
same `EGERIA_*` variables and defaults as the table below).
2. **Local browser:** `MY_EGERIA_PORT=8021 serve_my_egeria`, then open
`http://localhost:8021/`.
3. **Through the portal:** the `/my-egeria/` route loads the app and the
Expand All @@ -137,8 +152,9 @@ If the app loads but cannot reach Egeria, recheck `EGERIA_PLATFORM_URL` /
## Notes / gotchas

- The app module was renamed `my_egeria.my_egeria` → `my_egeria.my_egeria_app`.
egeria-workspaces should **not** reference the module path directly — only the
`serve_my_egeria` / `my_egeria` entry points, which are stable.
egeria-workspaces should **not** reference the module path or a file path
directly — only the `serve_my_egeria` / `serve_my_profile` / `my_egeria` entry
points, which are stable. (The packaging fix above moved the installed files.)
- If you template the compose service, keep one `MY_*_PORT` per app; only
`MY_EGERIA_HOST` is shared.
- "Adding more apps" recipe lives in `EGERIA_WORKSPACES_INTEGRATION.md`
Expand Down
28 changes: 19 additions & 9 deletions my_egeria/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,25 @@ If you have `uv` installed, you can sync the workspace from the root:
uv sync
```

## Running the app
You can run the app using:
```bash
uv run my-egeria
```
or
```bash
python -m my_egeria.main
```
## Running the apps
This package contains two Textual apps:

- **My Profile** (`DemoCode/My_Profile/`) — the actively developed app, and the one
the Egeria-Workspaces portal serves:
```bash
uv run my_profile # or: python -m my_egeria.DemoCode.My_Profile.my_profile_app
```
- **MyEgeria** — the original glossary/collection browser (not under active
development; several of its secondary screens are incomplete):
```bash
uv run my-egeria # or: python -m my_egeria.main
```

Both run in a terminal with the defaults below; set `EGERIA_USER` /
`EGERIA_USER_PASSWORD` to sign in as someone else (e.g. `peterprofile`, who has a
populated profile on the quickstart). For browser mode, see
`serve_my_profile` / `serve_my_egeria` in `EGERIA_WORKSPACES_INTEGRATION.md`.
Use Python 3.13 — Textual fails on Python 3.14.

## Configuration
The app uses the following environment variables (with defaults):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,8 @@ def search_for_the_term(self, search_term):
try:
self.search_result = exec_report_spec(format_set_name="Glossary-Terms",
output_format="MD",
params={"search_string": search_term, "filter_string": search_term},
params={"search_string": search_term, "filter_string": search_term,
"graph_query_depth": 0}, # term properties only
view_server=self.view_server,
view_url=self.platform_url,
user=self.user,
Expand Down
Loading
Loading