Skip to content

Add the Model Library config and its validator - #1810

Draft
arielsmoler wants to merge 1 commit into
mainfrom
model-library-config
Draft

arielsmoler wants to merge 1 commit into
mainfrom
model-library-config

Conversation

@arielsmoler

Copy link
Copy Markdown
Member

PR Description

Adds the config for the v2 web app's Model Library: the list of library notebooks it shows, each with a title, a description and labels, plus a pre-commit check for the file. Spec: Model Library — UX Spec, section "Integration with the Classiq Library".

Files

  • .internal/model_library/model_library_config.json — 53 notebooks, keyed by path. Each has title, description and labels (domain, framework, building_block, other). The allowed labels are the vocabulary at the top of the file.
  • .internal/pre_commit_tools/model_library_validate.py and a new validate-model-library-config hook. It checks that every path is an existing notebook listed once, that each entry has a non-empty title and description and the four label lists, and that every label is in the vocabulary and not repeated. It runs when the config or any notebook changes, so renaming or deleting a listed notebook fails the check.

No notebook is changed. The existing *.metadata.json files and their validator are untouched, so the v1 web app and the Library extension are unaffected.

Which notebooks. The 53 in-scope notebooks that ran end to end through the v2 web app's agent on nightly — results in Notebook Status on the v2 Web App. The other in-scope notebooks are added once the platform-side fixes listed there land.

Where the content comes from

  • Labels and titles: the agreed labels file (v5) reviewed with Matan and Tomer. The vocabulary is identical to it.
  • Descriptions: each notebook's .metadata.json, as already used by the web app's stand-in config. Six had placeholder text and were rewritten from the notebook's introduction: lchs, maxwell_2d_simulation, quantum_oracle_sketching_boolean, fermi_hubbard_1D, fermionic_gaussian, hybrid_qnn_for_subset_majority.

Open questions for review

  1. How the web app reads it. The spec assumed the library's deployment workflow would publish it, but those workflows were removed in dab1c1c. The web app's backend already reads notebooks from GitHub at a pinned commit, so it could read this file the same way — Oleh to confirm.
  2. Titles and descriptions in the config rather than taken from metadata.json at runtime (an open item in the spec). They are included here because the web app's backend expects them.

Some notes

  • pre-commit run on all changed files; all hooks pass.
  • No notebook, .qmod, .synthesis_options.json or .metadata.json file changed.

🤖 Generated with Claude Code

The config lists the 53 notebooks the v2 web app's Model Library shows,
each with a title, a description and labels from the agreed vocabulary.
A pre-commit hook validates it whenever the config or a notebook changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
"Computational Fluid Dynamics (CFD)",
"Cybersecurity",
"Healthcare & Life Sciences",
"Automotive",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are some entries that are unused. I guess this is OK, and initially we will get empty results for those filters.

return errors


def validate_config(config_path: Path = CONFIG_PATH) -> list[str]:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool. Maybe add a comment to the user which file needs to be updated. Say someone adds a new notebook, the pre-commit will not pass, but the contributor should know which file to modify.
It will be good if @classiqdor can automated this (we have such automations for the metadata of each notebook)

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants