Some checks failed
verify / verify (push) Has been cancelled
Separate local parsing from model indexing, bind review decisions to immutable manifests, persist vectors behind active profiles, and expose retrieval, chat, evaluation, and document workflows through the React workbench. Constraint: Live Bailian authentication currently fails for all three configured capabilities Rejected: Direct upload-to-embedding flow | bypasses local review and manifest binding Confidence: high Scope-risk: broad Directive: Keep private-data deployment blocked until authentication, RBAC, and separate database roles land Tested: make verify; fresh and replay Docker document smoke; worker recovery smoke; frozen synthetic evaluation; migration 0003-0004 roundtrip Not-tested: Successful live Bailian calls, OCR, real multi-user authorization
38 lines
1.3 KiB
Python
38 lines
1.3 KiB
Python
"""Stable identity and embedding profile for the public synthetic demo corpus."""
|
|
|
|
from __future__ import annotations
|
|
|
|
import hashlib
|
|
import json
|
|
import uuid
|
|
|
|
DEMO_SCOPE_NAME = "synthetic-demo"
|
|
DEMO_EXPECTED_CHUNKS = 20
|
|
DEMO_FAKE_EMBEDDING_MODEL = "fake-feature-hash-v1"
|
|
|
|
IDENTITY_NAMESPACE = uuid.UUID("eef85571-1f64-4a09-86d7-53fd329c3eb2")
|
|
KNOWLEDGE_BASE_ID = uuid.uuid5(IDENTITY_NAMESPACE, "synthetic-demo-knowledge-base")
|
|
ACCESS_SCOPE_ID = uuid.uuid5(IDENTITY_NAMESPACE, "synthetic-demo-public-scope")
|
|
BAILIAN_KNOWLEDGE_BASE_ID = uuid.uuid5(IDENTITY_NAMESPACE, "synthetic-bailian-knowledge-base")
|
|
BAILIAN_ACCESS_SCOPE_ID = uuid.uuid5(IDENTITY_NAMESPACE, "synthetic-bailian-public-scope")
|
|
|
|
|
|
def offline_embedding_profile_hash(dimension: int) -> str:
|
|
"""Return the exact profile bound to vectors produced by the offline embedder."""
|
|
|
|
profile = {
|
|
"api_mode": "deterministic-offline",
|
|
"dimension": dimension,
|
|
"endpoint_identity_hash": "local-fake",
|
|
"model": DEMO_FAKE_EMBEDDING_MODEL,
|
|
"normalization": "provider-default",
|
|
"profile_version": 1,
|
|
}
|
|
serialized = json.dumps(
|
|
profile,
|
|
ensure_ascii=False,
|
|
sort_keys=True,
|
|
separators=(",", ":"),
|
|
)
|
|
return hashlib.sha256(serialized.encode("utf-8")).hexdigest()
|