From 04a04e51accc8391726c87883da91efce9f8f14c Mon Sep 17 00:00:00 2001 From: autonomic-bot Date: Tue, 4 Aug 2026 16:58:30 +0000 Subject: [PATCH] session naming: archive- prefix convention + cc-ci-report unique-name invariant MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - _archive_stale_titles default label is now 'archive- —' (operator convention: all archived sessions start with archive- so they sort/filter together in the web UI). - launch-report.py start() archives older cc-ci-report sessions before launch, same invariant as upgrader/supervisor (reuses the launch-upgrader helper). - 33 sessions restyled/archived live; canonical names now unique: cc-ci-upgrader (idle finisher), cc-ci-report (generating), cc-ci-supervisor (none — only exists during a rescue). --- cc-ci-plan/launch-report.py | 12 ++++++++++++ cc-ci-plan/launch-supervisor.py | 2 +- cc-ci-plan/launch-upgrader.py | 4 +++- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/cc-ci-plan/launch-report.py b/cc-ci-plan/launch-report.py index 145b1bc..0f9bf7f 100755 --- a/cc-ci-plan/launch-report.py +++ b/cc-ci-plan/launch-report.py @@ -70,6 +70,18 @@ def start(mode, date): log(f"{SESSION} busy with a report — leaving it"); return log(f"{SESSION} exists (idle/leftover) — killing first"); kill_session(); time.sleep(1) + # Unique-name invariant (same as upgrader/supervisor): archive-rename every older session + # titled SESSION so the one this launch creates is the ONLY 'cc-ci-report' in the web UI. + # Archived names start with 'archive-' (operator convention 2026-08-04). + try: + import importlib.util as _ilu + _spec = _ilu.spec_from_file_location( + "launch_upgrader", os.path.join(os.path.dirname(os.path.realpath(__file__)), "launch-upgrader.py")) + _lu = _ilu.module_from_spec(_spec); _spec.loader.exec_module(_lu) + _lu._archive_stale_titles(SESSION) + except Exception as e: + log(f" (archive-rename skipped: {e})") + kf = Path(LOG_DIR) / f".kickoff-{SESSION}.txt" kf.write_text(build_kickoff(date)) model_flag = f"--model '{MODEL}'" if MODEL else "" diff --git a/cc-ci-plan/launch-supervisor.py b/cc-ci-plan/launch-supervisor.py index a89a2f2..dc8b287 100644 --- a/cc-ci-plan/launch-supervisor.py +++ b/cc-ci-plan/launch-supervisor.py @@ -101,7 +101,7 @@ def spawn_supervisor(sid, reason): # Unique-name invariant (same as the upgrader): archive-rename every older session titled # SUP_SESSION so the one this launch creates is the ONLY 'cc-ci-supervisor' in the web UI. try: - lu._archive_stale_titles(SUP_SESSION, "supervisor archive —") + lu._archive_stale_titles(SUP_SESSION) except Exception: pass kf = Path(LOG_DIR) / f".kickoff-{SUP_SESSION}.txt" diff --git a/cc-ci-plan/launch-upgrader.py b/cc-ci-plan/launch-upgrader.py index 0fd30c5..3de72a5 100644 --- a/cc-ci-plan/launch-upgrader.py +++ b/cc-ci-plan/launch-upgrader.py @@ -293,7 +293,9 @@ def _archive_stale_titles(title=None, label=None): title lookup in _session_id() unambiguous. Old runs stay browsable under '<label> — <date>'. Also used by launch-supervisor.py for its own session name.""" title = title or SESSION - label = label or ("upgrader archive — weekly" if title == "cc-ci-upgrader" else f"{title} archive —") + # Archive names always start with 'archive-' (operator convention 2026-08-04) so they + # sort/filter together in the web UI: 'archive-<original-title> — <date>'. + label = label or f"archive-{title} —" rows = _server_get("/session") or [] rows = rows if isinstance(rows, list) else rows.get("data", []) for s in rows: