docs: harden internal semantic doc state

This commit is contained in:
2026-08-08 21:00:50 +02:00
parent 22c3512ac8
commit aa502dcf7d
4 changed files with 275 additions and 59 deletions
@@ -132,6 +132,72 @@ sed '/^case "\$mode" in/,$d' "$root/scripts/verify-workspace-install-docs.sh" >"
# shellcheck source=/dev/null
source "$verifier_functions"
project_state_fixture="$negative_root/project-state.md"
python3 - "$root/PROJECT_STATE.md" "$project_state_fixture" <<'PY'
import pathlib, sys
source = pathlib.Path(sys.argv[1]).read_text()
target = pathlib.Path(sys.argv[2])
marker = source.index("## Historical snapshots")
contradiction = """
## Contradictory release note — LIVE 2026-08-08
- Schema-v2 descriptors are operational again.
- The supported Compose stack is exactly `frontend` plus `core`.
- DWH, vector DB, embedding, LLM, and reverse-proxy services are external configurable endpoints.
"""
target.write_text(source[:marker] + contradiction + source[marker:])
PY
project_state_output="$negative_root/project-state-output"
set +e
verify_project_state_current_contract "$project_state_fixture" contradictory-project-state >"$project_state_output" 2>&1
project_state_status=$?
set -e
if [[ $project_state_status -eq 0 ]] || ! grep -Fq "contradictory active text" "$project_state_output"; then
echo "contradictory current-state fixture was not rejected correctly" >&2
cat "$project_state_output" >&2
exit 1
fi
workspace_fixture="$negative_root/workspace-invalid.yaml"
python3 - "$root/deploy/workspaces/example.yaml" "$workspace_fixture" <<'PY'
import pathlib, sys, yaml
doc = yaml.safe_load(pathlib.Path(sys.argv[1]).read_text())
doc["semantic_index"]["embedding"]["dimensions"] = 768
pathlib.Path(sys.argv[2]).write_text(yaml.safe_dump(doc, sort_keys=False))
PY
workspace_output="$negative_root/workspace-output"
set +e
verify_workspace_descriptor_semantic_contract "$workspace_fixture" invalid-workspace >"$workspace_output" 2>&1
workspace_status=$?
set -e
if [[ $workspace_status -eq 0 ]] || ! grep -Fq "embedding dimensions must be 1024" "$workspace_output"; then
echo "semantic workspace fixture was not rejected correctly" >&2
cat "$workspace_output" >&2
exit 1
fi
project_state_positive="$negative_root/project-state-positive.md"
cat >"$project_state_positive" <<'EOF'
# ThothII — Project State
> Starting-point snapshot.
## Internal Qdrant + Ollama semantic infrastructure — LIVE 2026-08-08
- Schema-v3 descriptors are operational and v1/v2 remain `migration_required`.
- One workspace owns one Qdrant collection.
- Only DWH and LLM remain external runtime application endpoints.
- The internal stack includes `qdrant`, `embedding`, and `embedding-model-init`.
## Historical snapshots — superseded context
### Historical snapshot — previous deployment
- Older notes intentionally live only here.
EOF
verify_project_state_current_contract "$project_state_positive" positive-project-state >/dev/null
adapted_reorder="$negative_root/caddy-adapted-reorder.json"
adapted_bypass="$negative_root/caddy-adapted-bypass.json"
node - "$adapted_reorder" "$adapted_bypass" <<'NODE'