fix: detect Mercury stage per-view via session name
The Mercury app (3.2.x) is a hybrid server whose kernel pool serves both the client-facing app view and JupyterLab, so the server-level MERCURY_CONFIG_DIR signal cannot tell who is looking and leaks backstage content in the app. Switch the primary stage signal to the shadow-copy session name (__mercury__ in JPY_SESSION_NAME), keeping the env var only as a --working-dir fallback. - Update CX Discovery staging.py to the per-view detection model - Ignore Mercury runtime artifacts (.mercury_sessions/, *__mercury__*) - Document the leak in remaining masters (TEI, CTM, AI Diagnostic, template) and flag the staging.py retrofit as urgent
This commit is contained in:
@@ -70,6 +70,11 @@ def discover() -> list[str]:
|
||||
for p in root.rglob("*.ipynb"):
|
||||
if ".ipynb_checkpoints" in p.parts or ".venv" in p.parts:
|
||||
continue
|
||||
# Mercury app shadow copies are runtime artifacts, not masters
|
||||
# (layout varies by mercury version: .mercury_sessions/ or a
|
||||
# __mercury__ suffix beside the notebook).
|
||||
if ".mercury_sessions" in p.parts or "__mercury__" in p.name:
|
||||
continue
|
||||
if p.parent.name != "notebooks":
|
||||
continue
|
||||
found.append(p.relative_to(REPO).as_posix())
|
||||
|
||||
Reference in New Issue
Block a user