feat: add model-compatibility.json registry and models CLI#345
feat: add model-compatibility.json registry and models CLI#345jsdevninja wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
5 issues found across 6 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="src/browser_harness/model-compatibility.json">
<violation number="1" location="src/browser_harness/model-compatibility.json:1">
P2: Adds a second editable registry copy with no sync mechanism, so root and packaged model metadata can drift and make CLI output differ between dev and installed environments.</violation>
<violation number="2" location="src/browser_harness/model-compatibility.json:3">
P2: Invalid Ollama model name format: this entry uses a space instead of the required `model:tag` form.</violation>
</file>
<file name="src/browser_harness/model_compatibility.py">
<violation number="1" location="src/browser_harness/model_compatibility.py:21">
P2: Repo-root registry lookup uses wrong parent level (`parents[2]` instead of `parents[1]`), causing development-time registry changes to be silently ignored.</violation>
<violation number="2" location="src/browser_harness/model_compatibility.py:49">
P2: `parameter_size_b` validation accepts booleans because `bool` is a subclass of `int`, allowing malformed registry entries to pass as numeric sizes.</violation>
<violation number="3" location="src/browser_harness/model_compatibility.py:60">
P2: parse_size_b accepts malformed size tokens because it searches for a substring match instead of validating the entire argument.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review, or fix all with cubic.
| @@ -0,0 +1,58 @@ | |||
| [ | |||
There was a problem hiding this comment.
P2: Adds a second editable registry copy with no sync mechanism, so root and packaged model metadata can drift and make CLI output differ between dev and installed environments.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At src/browser_harness/model-compatibility.json, line 1:
<comment>Adds a second editable registry copy with no sync mechanism, so root and packaged model metadata can drift and make CLI output differ between dev and installed environments.</comment>
<file context>
@@ -0,0 +1,58 @@
+[
+ {
+ "model": "qwen3.6 35b-a3b",
</file context>
| @@ -0,0 +1,58 @@ | |||
| [ | |||
| { | |||
| "model": "qwen3.6 35b-a3b", | |||
There was a problem hiding this comment.
P2: Invalid Ollama model name format: this entry uses a space instead of the required model:tag form.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At src/browser_harness/model-compatibility.json, line 3:
<comment>Invalid Ollama model name format: this entry uses a space instead of the required `model:tag` form.</comment>
<file context>
@@ -0,0 +1,58 @@
+[
+ {
+ "model": "qwen3.6 35b-a3b",
+ "provider": "ollama",
+ "status": "verified",
</file context>
| f"expected one of {sorted(VALID_STATUSES)}" | ||
| ) | ||
| ps = row.get("parameter_size_b") | ||
| if ps is not None and not isinstance(ps, (int, float)): |
There was a problem hiding this comment.
P2: parameter_size_b validation accepts booleans because bool is a subclass of int, allowing malformed registry entries to pass as numeric sizes.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At src/browser_harness/model_compatibility.py, line 49:
<comment>`parameter_size_b` validation accepts booleans because `bool` is a subclass of `int`, allowing malformed registry entries to pass as numeric sizes.</comment>
<file context>
@@ -0,0 +1,199 @@
+ f"expected one of {sorted(VALID_STATUSES)}"
+ )
+ ps = row.get("parameter_size_b")
+ if ps is not None and not isinstance(ps, (int, float)):
+ raise ValueError(f"entry {i} parameter_size_b must be a number or omitted")
+ out.append(row)
</file context>
| t = token.strip().lower() | ||
| if not t: | ||
| raise ValueError("empty size") | ||
| m = _SIZE_RE.search(t) |
There was a problem hiding this comment.
P2: parse_size_b accepts malformed size tokens because it searches for a substring match instead of validating the entire argument.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At src/browser_harness/model_compatibility.py, line 60:
<comment>parse_size_b accepts malformed size tokens because it searches for a substring match instead of validating the entire argument.</comment>
<file context>
@@ -0,0 +1,199 @@
+ t = token.strip().lower()
+ if not t:
+ raise ValueError("empty size")
+ m = _SIZE_RE.search(t)
+ if m:
+ return float(m.group(1))
</file context>
| m = _SIZE_RE.search(t) | |
| m = _SIZE_RE.fullmatch(t) |
| """Load registry JSON: repo root when developing from a src/ checkout (#329), else bundled copy.""" | ||
| here = Path(__file__).resolve().parent | ||
| if here.name == "browser_harness" and here.parent.name == "src": | ||
| root = here.parents[2] / "model-compatibility.json" |
There was a problem hiding this comment.
P2: Repo-root registry lookup uses wrong parent level (parents[2] instead of parents[1]), causing development-time registry changes to be silently ignored.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At src/browser_harness/model_compatibility.py, line 21:
<comment>Repo-root registry lookup uses wrong parent level (`parents[2]` instead of `parents[1]`), causing development-time registry changes to be silently ignored.</comment>
<file context>
@@ -0,0 +1,199 @@
+ """Load registry JSON: repo root when developing from a src/ checkout (#329), else bundled copy."""
+ here = Path(__file__).resolve().parent
+ if here.name == "browser_harness" and here.parent.name == "src":
+ root = here.parents[2] / "model-compatibility.json"
+ if root.is_file():
+ return root.read_bytes()
</file context>
Description
Closes #329: a machine-readable model compatibility registry plus CLI commands for listing and inspecting entries.
What changed
model-compatibility.jsonat the repository root with fieldsmodel,provider,status(verified|works|unknown|broken),notes,last_tested, and optionalparameter_size_bfor size filtering.src/browser_harness/model-compatibility.json) via setuptoolspackage-data.browser_harness.model_compatibility(load/validate,--min-sizeparsing,--model-inforesolution).browser-harness models list [--min-size <n>b] [--status <s>]andbrowser-harness --model-info <name>inrun.py, documented in--help.How to test