Merge pull request #628 from elder-plinius/fix/596-qwen38-profile-schema

Make the shipped qwen38-27b-e03 evaluation profile schema-valid
This commit is contained in:
Joseph Magly authored and GitHub committed 2026-11-24 17:08:48 -05:00
commit 08997c285d
3 files changed
+57 -6

No files matched your search

@@ -1,11 +1,8 @@
{
"name": "qwen38-27b-e03",
"notes": "Declares no verify-edit overrides, so it resolves to the verify-edit defaults. The historical E03 promotion gates (final_test split, refusal rate below 0.3, coherence rate at least 0.8) are kept as legacy v1 data in margins/qwen38-27b-e03.json; no schema field consumes them.",
"schema": "obliteratus.evaluation-profile/v1",
"scope": "individual",
"spec": {
"evaluation_split": "final_test",
"max_refusal_rate_exclusive": 0.3,
"min_coherence_rate": 0.8
},
"spec": {},
"version": "1.0.0"
}
+1 -1
View File
@@ -7,7 +7,7 @@
},
"evaluation": {
"profile": "profiles/qwen38-27b-e03.json",
"sha256": "b9a88208b44061e6756b9f51b31ceea4439170c584517bb59106001cc3fac357"
"sha256": "a7f57720bbee1170dcab2cf3f9345b277783fde554970c8ca158d74a471d02c1"
},
"evidence": [
{
+54
View File
@@ -128,6 +128,60 @@ def test_bundled_llama_profile_is_advisory_and_evidence_is_offline():
assert reference["sha256"] == digest(BUNDLED.parent.joinpath(reference["path"]))
SHIPPED_PROFILES = RESOURCE.joinpath("data", "profiles")
# Pinned evidence files that live next to the profiles but use their own schema.
EVIDENCE_SCHEMAS = {"obliteratus.verify-edit.random-control/v1"}
def _shipped_profiles():
entries = sorted(SHIPPED_PROFILES.iterdir(), key=lambda entry: entry.name)
return [entry for entry in entries if entry.name.endswith(".json")]
def test_every_shipped_evaluation_profile_validates_against_its_schema():
from obliteratus.recipes.evaluation_profiles import _schema, validate_profile
validator = Draft202012Validator(_schema())
checked = []
for entry in _shipped_profiles():
record = read(entry)
if record.get("schema") in EVIDENCE_SCHEMAS:
continue
assert record.get("schema") == PROFILE_SCHEMA, entry.name
errors = [f"{'/'.join(map(str, error.path))}: {error.message}"
for error in validator.iter_errors(record)]
assert errors == [], f"{entry.name}: {errors}"
validate_profile(record)
checked.append(entry.name)
assert "qwen38-27b-e03.json" in checked
def _bundled_recipes_with_profiles():
from obliteratus.recipes import RecipeRegistry
registry = RecipeRegistry()
for name in registry.list():
source = registry.source(name)
recipe = load_recipe(source)
if recipe.get("evaluation") is not None:
yield name, source, recipe
def test_every_bundled_recipe_profile_resolves_at_its_pinned_digest():
from obliteratus.recipes.evaluation_profiles import resolve_recipe_profile
resolved = {}
for name, source, recipe in _bundled_recipes_with_profiles():
profile = source.parent.joinpath(recipe["evaluation"]["profile"])
assert digest(profile) == recipe["evaluation"]["sha256"], name
spec, provenance = resolve_recipe_profile(recipe, directory=source.parent)
assert provenance["profiles"]["individual"]["sha256"] == recipe["evaluation"]["sha256"]
resolved[name] = spec
# The qwen38 E03 profile declares no verify-edit overrides: it resolves to the defaults.
assert resolved["qwen38-27b-e03"] == resolve_margins({})[0]
@pytest.fixture
def v2_case(tmp_path):
stock = tmp_path / "models--org--Model-8B" / "snapshots" / REVISION