feat: unify installation model catalog
This commit is contained in:
@@ -14,9 +14,9 @@ from pathlib import Path
|
||||
WORKSPACE_REGION = "workspace-descriptor-contract"
|
||||
NON_WORKSPACE_REGION = "non-workspace-migration"
|
||||
HISTORICAL_ARCHIVE_H1 = "# Historical archive"
|
||||
CANONICAL_V3_SENTENCE = "Schema v3 is the only accepted workspace descriptor."
|
||||
CANONICAL_V4_SENTENCE = "Schema v4 is the only accepted workspace descriptor."
|
||||
CANONICAL_REJECTION_SENTENCE = (
|
||||
"Schema v1 and v2 workspace descriptors are rejected before activation."
|
||||
"Schema v1, v2, and v3 workspace descriptors are rejected before activation."
|
||||
)
|
||||
|
||||
_MARKER_LINE = re.compile(
|
||||
@@ -34,8 +34,8 @@ _DELETED_TOOL = re.compile(
|
||||
re.IGNORECASE,
|
||||
)
|
||||
_REMAINING_LEGACY_CLAIM = re.compile(
|
||||
r"\b(?:schema(?:[- ]v?|\s+version\s*)[12]|"
|
||||
r"schema_version\s*[:=]\s*[12]|version\s*[12]|v[12]|"
|
||||
r"\b(?:schema(?:[- ]v?|\s+version\s*)[123]|"
|
||||
r"schema_version\s*[:=]\s*[123]|version\s*[123]|v[123]|"
|
||||
r"legacy(?:[-\s]+workspace)?[-\s]+descriptors?)\b",
|
||||
re.IGNORECASE,
|
||||
)
|
||||
@@ -48,9 +48,9 @@ _CODE_RESTORE = str.maketrans(
|
||||
)
|
||||
|
||||
_OUTSIDE_LEGACY_REFERENCE = re.compile(
|
||||
r"\b(?:schema(?:[- ]v?|\s+version\s*)[12]|"
|
||||
r"schema_version\s*[:=]\s*[12]|"
|
||||
r"(?:v[12](?:\s*(?:/|and|or)\s*v[12])?)\s+(?:workspace\s+)?descriptors?|"
|
||||
r"\b(?:schema(?:[- ]v?|\s+version\s*)[123]|"
|
||||
r"schema_version\s*[:=]\s*[123]|"
|
||||
r"(?:v[123](?:\s*(?:/|and|or|,)\s*v[123])*)\s+(?:workspace\s+)?descriptors?|"
|
||||
r"legacy(?:[-\s]+workspace)?[-\s]+descriptors?)\b",
|
||||
re.IGNORECASE,
|
||||
)
|
||||
@@ -355,11 +355,11 @@ def check_document_text(text: str, label: str = "document") -> None:
|
||||
workspace_prose = _render_prose_markdown(
|
||||
scan.prose_text[workspace.start : workspace.end]
|
||||
)
|
||||
if _exact_sentence_count(workspace_prose, CANONICAL_V3_SENTENCE) != 1:
|
||||
raise ContractError(f"{label}: workspace contract lacks the canonical v3-only sentence")
|
||||
if _exact_sentence_count(workspace_prose, CANONICAL_V4_SENTENCE) != 1:
|
||||
raise ContractError(f"{label}: workspace contract lacks the canonical v4-only sentence")
|
||||
if _exact_sentence_count(workspace_prose, CANONICAL_REJECTION_SENTENCE) != 1:
|
||||
raise ContractError(
|
||||
f"{label}: workspace contract lacks the canonical v1/v2 rejection sentence"
|
||||
f"{label}: workspace contract lacks the canonical v1/v2/v3 rejection sentence"
|
||||
)
|
||||
|
||||
workspace_visible = _render_markdown(scan.operator_text[workspace.start : workspace.end])
|
||||
|
||||
Reference in New Issue
Block a user