docs: make schema v3 the only workspace contract

This commit is contained in:
2026-08-11 02:53:41 +02:00
parent edef085fea
commit 5310c6555b
9 changed files with 1180 additions and 123 deletions
+18 -12
View File
@@ -105,6 +105,14 @@ for token in tokens:
PY
}
verify_workspace_descriptor_doc_contract() {
local source="$1" label="$2"
if ! python3 "$root/scripts/workspace_descriptor_doc_contract.py" --document "$source"; then
echo "$label violates the workspace descriptor documentation contract" >&2
return 1
fi
}
verify_markdown_table_relationships() {
local source="$1" label="$2" heading="$3" spec_json="$4"
python3 - "$source" "$label" "$heading" "$spec_json" <<'PY'
@@ -588,21 +596,20 @@ verify_vector_helper_interfaces() {
verify_project_state_current_contract() {
local source="${1:-$root/PROJECT_STATE.md}"
local label="${2:-PROJECT_STATE.md}"
if ! python3 "$root/scripts/workspace_descriptor_doc_contract.py" --project-state "$source"; then
echo "$label violates the workspace descriptor documentation contract" >&2
return 1
fi
python3 - "$source" "$label" <<'PY'
import pathlib, re, sys
text = pathlib.Path(sys.argv[1]).read_text()
label = sys.argv[2]
marker = re.search(r"^## Historical snapshots\b", text, re.MULTILINE)
marker = re.search(r"^# Historical archive$", text, re.MULTILINE)
if not marker:
raise SystemExit(f"{label}: missing Historical snapshots boundary")
raise SystemExit(f"{label}: missing Historical archive boundary")
current = text[:marker.start()]
historical = text[marker.start():]
if not re.search(r"Internal Qdrant \+ Ollama semantic infrastructure", current, re.MULTILINE):
raise SystemExit(f"{label}: current section missing internal semantic snapshot heading")
if not re.search(r"Schema-v3 descriptors are operational", current, re.MULTILINE):
raise SystemExit(f"{label}: current section must say schema-v3 is operational")
if "migration_required" not in current:
raise SystemExit(f"{label}: current section must mention migration_required")
if not re.search(r"\b(one|single)\b.*\bworkspace\b.*\b(one|single)\b.*\bQdrant\b.*\bcollection\b", current, re.IGNORECASE | re.DOTALL):
raise SystemExit(f"{label}: current section must describe one-workspace/one-collection ownership")
if not re.search(r"\bDWH\b", current) or not re.search(r"\bLLM\b", current):
@@ -612,7 +619,6 @@ if not re.search(r"\bexternal\b", current, re.IGNORECASE):
if "embedding-model-init" not in current:
raise SystemExit(f"{label}: current section missing embedding-model-init")
forbidden = [
r"Schema-v2 descriptors are operational",
r"supported Compose stack is exactly `frontend` plus `core`",
r"DWH, vector DB, embedding, LLM",
r"vector DB, embedding, and LLM remain external",
@@ -620,8 +626,6 @@ forbidden = [
for pattern in forbidden:
if re.search(pattern, current, re.MULTILINE):
raise SystemExit(f"{label}: current section still contains contradictory active text: {pattern}")
if re.search(r"^#{1,6}[^\n]*\b(LIVE|live|current state|current-state|Current state|Current-state)\b", historical, re.MULTILINE):
raise SystemExit(f"{label}: historical section still contains active/live heading markers")
PY
}
@@ -640,6 +644,10 @@ verify_internal_semantic_infrastructure_docs() {
verify_workspace_descriptor_semantic_contract "$root/deploy/workspaces/psd.yaml.example" "psd workspace example" || return 1
verify_vector_helper_interfaces || return 1
verify_project_state_current_contract "$root/PROJECT_STATE.md" "PROJECT_STATE.md" || return 1
verify_workspace_descriptor_doc_contract "$readme" "README" || return 1
verify_workspace_descriptor_doc_contract "$local_manual" "local workspace manual" || return 1
verify_workspace_descriptor_doc_contract "$server_manual" "server workspace manual" || return 1
verify_workspace_descriptor_doc_contract "$diagnostics" "workspace diagnostic protocol" || return 1
local ownership_spec semantic_index_spec compact_spec
ownership_spec='{"rows":[
@@ -670,13 +678,11 @@ verify_internal_semantic_infrastructure_docs() {
require_pattern "$agents" "AGENTS.md" 'DWH and LLM remain external configuration endpoints' || return 1
for manual in "$local_manual" "$server_manual"; do
require_pattern "$manual" "$(basename "$manual")" 'qwen3-embedding:0\.6b' || return 1
require_pattern "$manual" "$(basename "$manual")" 'migration_required' || return 1
done
require_pattern "$local_manual" "local workspace manual" 'CPU-first' || return 1
require_pattern "$local_manual" "local workspace manual" 'THOTH_ENABLE_EMBEDDING_GPU=1' || return 1
require_pattern "$server_manual" "server workspace manual" 'Qdrant backup/restore' || return 1
require_pattern "$compact_manual" "four-context install note" '1024 dimensioni' || return 1
require_pattern "$diagnostics" "workspace diagnostic protocol" 'schema version 3' || return 1
require_pattern "$diagnostics" "workspace diagnostic protocol" 'semantic_index_incompatible' || return 1
require_absent "$diagnostics" "workspace diagnostic protocol" \
'engine: pgvector' \