feat: advance repository records and provenance
Assistant: codex Assistant-Model: gpt-5.6-sol Assistant-Session: 01a023c0-a0a3-7c03-b395-5a0d2757214d
This commit is contained in:
parent
329af60753
commit
35e86d7b85
24 changed files with 1618 additions and 51 deletions
38
tests/test_classification.py
Normal file
38
tests/test_classification.py
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from pathlib import Path
|
||||
|
||||
import pytest
|
||||
|
||||
from repo_manager.classification import ClassificationError, validate_classification
|
||||
from repo_manager.observe import load_classification
|
||||
|
||||
|
||||
def test_classification_contract_accepts_canon_values() -> None:
|
||||
assert not validate_classification(
|
||||
{
|
||||
"category": "tooling",
|
||||
"domain": "infotech",
|
||||
"secondary_domains": ["agents"],
|
||||
"capability_tags": ["repository-control"],
|
||||
"business_stake": ["technology"],
|
||||
"business_mechanics": ["control"],
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
def test_load_classification_rejects_invalid_authority(tmp_path: Path) -> None:
|
||||
(tmp_path / ".repo-classification.yaml").write_text(
|
||||
"repo_classification:\n"
|
||||
" category: health\n"
|
||||
" domain: infotech\n"
|
||||
" secondary_domains: [infotech, nowhere]\n"
|
||||
" capability_tags: [Bad_Tag]\n",
|
||||
encoding="utf-8",
|
||||
)
|
||||
with pytest.raises(ClassificationError) as raised:
|
||||
load_classification(tmp_path)
|
||||
message = str(raised.value)
|
||||
assert "category" in message
|
||||
assert "secondary_domains" in message
|
||||
assert "capability_tags" in message
|
||||
Loading…
Add table
Add a link
Reference in a new issue