From ae0c9ab8b9c2a38b4c896f96017843cddcc7eef6 Mon Sep 17 00:00:00 2001 From: Omar Adalat <47933317+nightly@users.noreply.github.com> Date: Sun, 23 Aug 2026 21:11:17 -0400 Subject: [PATCH] Validate exact current Accord Marimo notebook blob --- .github/workflows/validate-accord-marimo.yml | 24 +++++ validation/accord-marimo/data_explorer_mo.py | 105 +++++++++++++++++++ validation/accord-marimo/pyproject.toml | 10 ++ 3 files changed, 139 insertions(+) create mode 100644 .github/workflows/validate-accord-marimo.yml create mode 100644 validation/accord-marimo/data_explorer_mo.py create mode 100644 validation/accord-marimo/pyproject.toml diff --git a/.github/workflows/validate-accord-marimo.yml b/.github/workflows/validate-accord-marimo.yml new file mode 100644 index 0000000..84625f7 --- /dev/null +++ b/.github/workflows/validate-accord-marimo.yml @@ -0,0 +1,24 @@ +name: Validate Accord Marimo notebook + +on: + push: + branches: + - ci/accord-marimo-check-20260824 + pull_request: + branches: + - master + +permissions: + contents: read + +jobs: + marimo-check: + runs-on: ubuntu-latest + timeout-minutes: 10 + steps: + - uses: actions/checkout@v5 + - uses: astral-sh/setup-uv@v7 + - name: Run the real Marimo checker + run: >- + uv run --project validation/accord-marimo marimo check --strict + validation/accord-marimo/data_explorer_mo.py diff --git a/validation/accord-marimo/data_explorer_mo.py b/validation/accord-marimo/data_explorer_mo.py new file mode 100644 index 0000000..2bb35eb --- /dev/null +++ b/validation/accord-marimo/data_explorer_mo.py @@ -0,0 +1,105 @@ +# /// script +# requires-python = ">=3.11" +# dependencies = [ +# "marimo>=0.24.0", +# ] +# /// + +import marimo + +__generated_with = "0.24.0" +app = marimo.App(width="full") + + +@app.cell +def _(dashboard): + dashboard + return + + +@app.cell +def _(): + import sys + from pathlib import Path + + repo_root = Path(__file__).resolve().parents[1] + if str(repo_root) not in sys.path: + sys.path.insert(0, str(repo_root)) + + from src.stage4_explorer_data import empty_record, load_records + from src.stage4_explorer_ui import ( + build_dashboard, + corpus_summary, + filter_records, + make_detail_controls, + make_global_controls, + make_task_picker, + ) + + task_records, illustrative_records = load_records(repo_root / "data" / "stage4") + domains = sorted({_record["domain"] for _record in task_records}) + families = sorted({_record["family"] for _record in task_records}) + return ( + build_dashboard, + corpus_summary, + domains, + empty_record, + families, + filter_records, + illustrative_records, + make_detail_controls, + make_global_controls, + make_task_picker, + task_records, + ) + + +@app.cell +def _(domains, families, illustrative_records, make_global_controls): + global_controls = make_global_controls(domains, families, illustrative_records) + return (global_controls,) + + +@app.cell +def _(filter_records, global_controls, make_task_picker, task_records): + filtered_records = filter_records(task_records, global_controls) + task_picker = make_task_picker(filtered_records) + return filtered_records, task_picker + + +@app.cell +def _(empty_record, task_picker, task_records): + selected_record = ( + next(_record for _record in task_records if _record["key"] == task_picker.value) + if task_picker.value is not None + else empty_record() + ) + return (selected_record,) + + +@app.cell +def _(make_detail_controls, selected_record): + detail_controls = make_detail_controls(selected_record) + return (detail_controls,) + + +@app.cell +def _( + build_dashboard, + corpus_summary, + detail_controls, + filtered_records, + global_controls, + illustrative_records, + selected_record, + task_picker, + task_records, +): + complete_controls = {**global_controls, "task": task_picker} + corpus = corpus_summary(task_records, illustrative_records, len(filtered_records)) + dashboard = build_dashboard(selected_record, complete_controls, detail_controls, corpus) + return (dashboard,) + + +if __name__ == "__main__": + app.run() diff --git a/validation/accord-marimo/pyproject.toml b/validation/accord-marimo/pyproject.toml new file mode 100644 index 0000000..d17043e --- /dev/null +++ b/validation/accord-marimo/pyproject.toml @@ -0,0 +1,10 @@ +[project] +name = "accord-marimo-validation" +version = "0.0.0" +requires-python = ">=3.11" +dependencies = [ + "marimo==0.24.0", +] + +[tool.uv] +package = false