* feat(packs/register): materialise A_depth drafted registers Lands 3 drafted depth registers, dominated by disclosure-domain count and structural compression/expansion knobs; the sealed reports keep grounding_source and trace_hash byte-identical to the unregistered path. Also aligns the smoke contract assertion with the current pack-grounded unknown evidence split. * feat(packs/register): materialise B_tone drafted registers Lands 15 drafted tone registers, dominated by bounded affective opening and closing marker palettes; the sealed reports keep grounding_source and trace_hash byte-identical to the unregistered path. * feat(packs/register): materialise C_stance drafted registers Lands 11 drafted stance registers, dominated by epistemic posture markers plus light deterministic depth clauses; the sealed reports keep grounding_source and trace_hash byte-identical to the unregistered path. * feat(packs/register): materialise D_posture drafted registers Lands 10 drafted posture registers, dominated by role-shaped marker families for peer, mentor, scholar, practitioner, and related voices; the sealed reports keep grounding_source and trace_hash byte-identical to the unregistered path. * feat(packs/register): materialise E_domain drafted registers Lands 11 drafted domain registers, dominated by academic, executive, technical, legal, scientific, and philosophical marker families with bounded known-key knobs; the sealed reports keep grounding_source and trace_hash byte-identical to the unregistered path. * feat(packs/register): materialise F_cultural drafted registers Lands 12 drafted cultural registers, dominated by plainspoken, diplomatic, classic, contemporary, and lyrical marker palettes; the sealed reports keep grounding_source and trace_hash byte-identical to the unregistered path. * feat(packs/register): materialise G_affective drafted registers Lands 10 drafted affective registers, dominated by cheerful, somber, grave, wry, gentle, and earnest marker families; the sealed reports keep grounding_source and trace_hash byte-identical to the unregistered path. * feat(packs/register): materialise H_functional drafted registers Lands 10 drafted functional registers, dominated by documentary, instructional, persuasive, clarifying, comparing, and exemplifying marker families; the sealed reports keep grounding_source and trace_hash byte-identical to the unregistered path. * feat(packs/register): materialise I_composite drafted registers Lands 11 drafted composite registers, dominated by combined knob and marker families for tutorial, interview, briefing, lecture, memo, story, elegy, epigram, and manifesto voices; the sealed reports keep grounding_source and trace_hash byte-identical to the unregistered path.
60 lines
2.2 KiB
Python
60 lines
2.2 KiB
Python
from __future__ import annotations
|
|
|
|
import re
|
|
|
|
from chat.runtime import ChatRuntime, _UNKNOWN_DOMAIN_SURFACE
|
|
from core.config import RuntimeConfig
|
|
|
|
_GREEK_RE = re.compile(r"[\u0370-\u03ff\u1f00-\u1fff]")
|
|
_HEBREW_RE = re.compile(r"[\u0590-\u05ff]")
|
|
|
|
|
|
def _is_english_surface(text: str) -> bool:
|
|
return not _GREEK_RE.search(text) and not _HEBREW_RE.search(text)
|
|
|
|
|
|
def test_default_runtime_emits_english_surface() -> None:
|
|
runtime = ChatRuntime()
|
|
response = runtime.chat("word beginning truth")
|
|
assert response.output_language == "en"
|
|
assert response.frame_pack == "en"
|
|
assert _is_english_surface(response.surface)
|
|
|
|
|
|
def test_trilanguage_mounted_runtime_still_emits_english_surface_by_default() -> None:
|
|
runtime = ChatRuntime(
|
|
config=RuntimeConfig(
|
|
input_packs=("en_minimal_v1", "he_logos_micro_v1", "grc_logos_micro_v1"),
|
|
output_language="en",
|
|
frame_pack="en",
|
|
)
|
|
)
|
|
runtime.chat("word beginning truth")
|
|
response = runtime.chat("word beginning truth")
|
|
assert _is_english_surface(response.surface)
|
|
assert response.proposition.frame_id.startswith("en:")
|
|
|
|
|
|
def test_greek_output_language_emits_greek_surface() -> None:
|
|
runtime = ChatRuntime(
|
|
config=RuntimeConfig(
|
|
input_packs=("en_minimal_v1", "he_logos_micro_v1", "grc_logos_micro_v1"),
|
|
output_language="grc",
|
|
frame_pack="grc",
|
|
)
|
|
)
|
|
runtime.chat("logos arche aletheia")
|
|
response = runtime.chat("logos arche aletheia")
|
|
assert response.output_language == "grc"
|
|
assert response.frame_pack == "grc"
|
|
assert _GREEK_RE.search(response.surface)
|
|
assert response.proposition.frame_id.startswith(("grc:", "el:"))
|
|
|
|
|
|
def test_chat_response_preserves_pack_grounded_unknown_evidence() -> None:
|
|
runtime = ChatRuntime(config=RuntimeConfig(output_language="en", frame_pack="en"))
|
|
response = runtime.chat("word beginning truth")
|
|
assert response.surface.startswith("Pack-resident tokens")
|
|
assert response.articulation.surface == _UNKNOWN_DOMAIN_SURFACE
|
|
assert response.articulation_surface == _UNKNOWN_DOMAIN_SURFACE
|
|
assert response.walk_surface == _UNKNOWN_DOMAIN_SURFACE
|