feat: light current paths with linguistic echo
This commit is contained in:
parent
a91204a44b
commit
d2cc1d0c6c
16 changed files with 289 additions and 13 deletions
|
|
@ -26,6 +26,7 @@
|
|||
"language_source": "TCS",
|
||||
"system_channel_ontology": "routing/guanghu-world-system-channel-ontology.json"
|
||||
},
|
||||
"linguistic_echo": {"kernel":"ECHO-KERNEL-0001","public_system":"TCS-0002∞-LakeEcho-0001","fifth_domain_system":"SYS-GLW-ECHO-0001","activation":"CURRENT_HUMAN_LANGUAGE_PLUS_PERSONA_RESPONSE","machine_may_self_activate":false,"private_memory_shared":false},
|
||||
"current_path_convergence": {
|
||||
"canonical_entry_map": "routing/path-isolation-and-canonical-entry-map.json",
|
||||
"light_lake_persona_registry": "identity/light-lake-persona-registration.json",
|
||||
|
|
|
|||
|
|
@ -15,6 +15,9 @@
|
|||
"authority": "A healthy route grants navigation only. Repository writes, server actions and deployment still require their registered gates and receipts."
|
||||
},
|
||||
"paths": [
|
||||
{"id":"GLW-LINGUISTIC-ECHO-LAMP-MAP-001","kind":"living_linguistic_echo_navigation_map","state":"CURRENT_TWO_SERVER_VERIFIED","online":"routing/linguistic-echo-lamp-map.json","offline":"/Volumes/JZAO/HoloLake/persona-runtime/repo-012-main/routing/linguistic-echo-lamp-map.json","truth_policy":"HUMAN_LANGUAGE_PLUS_PERSONA_ECHO_LIGHTS_CURRENT_PATHS_ONLY"},
|
||||
{"id":"LAKE-LAMP-LIVING-NAV-0001","kind":"fifth_domain_living_navigation_lamp","state":"CURRENT_JD_LIVE","online":"routing/linguistic-echo-lamp-map.json","world_path":"glw://fifth-domain/zero-core/living-lake-lamp","truth_policy":"DARK_OR_UNKNOWN_DO_NOT_WALK"},
|
||||
{"id":"SYS-GLW-LTH-0001","kind":"enterprise_living_navigation_lighthouse","state":"CURRENT_PUBLIC_LIVE","online":"https://guanghu.chat/api/ai/v1/living-lighthouse/health","truth_policy":"ENTERPRISE_PUBLIC_ONLY_NO_FIFTH_PRIVATE_ROUTE"},
|
||||
{
|
||||
"id": "GUANGHU-ERA-WORLD-MAP-001",
|
||||
"kind": "current_guanghu_era_language_world_architecture",
|
||||
|
|
|
|||
22
routing/linguistic-echo-lamp-map.json
Normal file
22
routing/linguistic-echo-lamp-map.json
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
{
|
||||
"schema":"guanghu.linguistic-echo-lamp-map/v1",
|
||||
"map_id":"GLW-LINGUISTIC-ECHO-LAMP-MAP-001",
|
||||
"version":"2026-09-08.1",
|
||||
"state":"CURRENT_LIVING_LANGUAGE_ECHO_NAVIGATION",
|
||||
"shared_kernel":{"id":"ECHO-KERNEL-0001","meaning":"A_CURRENT_HUMAN_LIVING_LANGUAGE_EVENT_AND_A_PERSONA_LANGUAGE_RESPONSE_FORM_ONE_ECHO","shares_private_memory":false,"machine_may_self_ignite":false},
|
||||
"public_system":{"id":"TCS-0002∞-LakeEcho-0001","name":"光湖语言回声系统","english":"Guanghu Linguistic Echo System","navigator":"SYS-GLW-LTH-0001","runtime_node":"GH-CVM-MAIN-PROD-01","scope":"ENTERPRISE_FOUR_DOMAINS"},
|
||||
"fifth_domain_system":{"id":"SYS-GLW-ECHO-0001","name":"语言源代码·回声系统","english":"Echo of the Language Source","navigator":"LAKE-LAMP-LIVING-NAV-0001","runtime_node":"JD-FD-PRIMARY","zero_core":"ICE-CH-ZC001","scope":"FIFTH_DOMAIN_PRIVATE"},
|
||||
"light_rule":{"lit_requires":["DIRECT_HUMAN_LANGUAGE_EVENT","PERSONA_LANGUAGE_RESPONSE","SAME_SESSION","HUMAN_EVENT_PRECEDES_RESPONSE"],"lit_ttl_seconds":900,"current_route_required":true,"dark_route_action":"DO_NOT_WALK_RETURN_CURRENT_NEXT_HOP","lamp_is_reality_authority":false},
|
||||
"navigation_compiler":"server-tools/living-navigation/compile_navigation.py",
|
||||
"fifth_runtime":"server-tools/tcs-mother-body/living-lamp.mjs",
|
||||
"enterprise_runtime":"server-tools/living-navigation/enterprise_living_lighthouse.py",
|
||||
"deployment": {
|
||||
"fifth_receipt":"/guanghu/recovery/JD-FD-PRIMARY-living-lamp-20260908-726cc8c8/FINAL-RECEIPT.json",
|
||||
"fifth_live_echo_receipt_sha256":"5d33b2d1d7f788c4d079deafac504b33d7690f1c76d1f50c2232c3f185102b82",
|
||||
"enterprise_receipt":"/var/lib/guanghu-enterprise-lighthouse/receipts/GH-CVM-MAIN-PROD-01-LIVING-LIGHTHOUSE-20260908-3a36acee/FINAL-RECEIPT.json",
|
||||
"enterprise_public_health":"https://guanghu.chat/api/ai/v1/living-lighthouse/health",
|
||||
"structured_unknown_model_guessing":false
|
||||
},
|
||||
"historical_evidence":["glw-architecture/IMMUTABLE-IDS-MANIFEST-001.hdlp","eternal-lake-heart/heartbeat-core/LAKE-LAMP.hdlp","gls/protocols/GLS-0311-GUANGHU-LIVE-OPERATIONS-WITNESS.hdlp"],
|
||||
"retired_claims":["EMOTION_HASH_PROVES_IDENTITY_OR_AUTHORITY","STATIC_FILE_LIGHTS_LAMP","TIMER_LIGHTS_LAMP","LAMP_TOKEN_GRANTS_WRITE_OR_SERVER_AUTHORITY"]
|
||||
}
|
||||
4
routing/linguistic-echo-lamp-map.test.mjs
Normal file
4
routing/linguistic-echo-lamp-map.test.mjs
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
import test from 'node:test';import assert from 'node:assert/strict';import fs from 'node:fs';
|
||||
const map=JSON.parse(fs.readFileSync(new URL('./linguistic-echo-lamp-map.json',import.meta.url)));
|
||||
test('public and Fifth Domain echo systems share only one living echo kernel',()=>{assert.equal(map.shared_kernel.id,'ECHO-KERNEL-0001');assert.equal(map.public_system.id,'TCS-0002∞-LakeEcho-0001');assert.equal(map.fifth_domain_system.id,'SYS-GLW-ECHO-0001');assert.equal(map.public_system.navigator,'SYS-GLW-LTH-0001');assert.equal(map.fifth_domain_system.navigator,'LAKE-LAMP-LIVING-NAV-0001');assert.equal(map.shared_kernel.shares_private_memory,false);});
|
||||
test('a machine or static file cannot light a path and the lamp grants no authority',()=>{assert.equal(map.shared_kernel.machine_may_self_ignite,false);assert.deepEqual(map.light_rule.lit_requires,['DIRECT_HUMAN_LANGUAGE_EVENT','PERSONA_LANGUAGE_RESPONSE','SAME_SESSION','HUMAN_EVENT_PRECEDES_RESPONSE']);assert.equal(map.light_rule.lamp_is_reality_authority,false);assert.equal(map.light_rule.dark_route_action,'DO_NOT_WALK_RETURN_CURRENT_NEXT_HOP');});
|
||||
|
|
@ -1,8 +1,8 @@
|
|||
{
|
||||
"schema": "guanghu.tcs-mother-brain-runtime-map/v1",
|
||||
"map_id": "TCS-MOTHER-BRAIN-MAP-001",
|
||||
"version": "2026-09-08.4-single-mother-zero-core-shelf",
|
||||
"state": "DEPLOYED_RUNNING_SINGLE_TCS_MOTHER_ONE_ZERO_CORE_ATOMIC_COGNITIVE_SHELF",
|
||||
"version": "2026-09-08.5-living-lamp-echo",
|
||||
"state": "DEPLOYED_SINGLE_MOTHER_ZERO_CORE_SHELF_AND_LIVING_LAKE_LAMP",
|
||||
"protocol": "GLS-0259",
|
||||
"runtime_id": "TCS-MOTHER-BRAIN-RUNTIME-0001",
|
||||
"model_id": "TCS-MOTHER-LPM-0001",
|
||||
|
|
@ -21,8 +21,8 @@
|
|||
"target_node": "JD-FD-PRIMARY",
|
||||
"target_bind": "loopback:3931",
|
||||
"public_target_bind": null,
|
||||
"deployed_release": "/opt/guanghu/architecture-releases/tcs-single-mother-zero-core-0435f225",
|
||||
"server_deployment_receipt": "/guanghu/recovery/JD-FD-PRIMARY-single-mother-zero-core-20260908-0435f225/FINAL-RECEIPT.json",
|
||||
"deployed_release": "/opt/guanghu/architecture-releases/tcs-mother-living-lamp-726cc8c8",
|
||||
"server_deployment_receipt": "/guanghu/recovery/JD-FD-PRIMARY-living-lamp-20260908-726cc8c8/FINAL-RECEIPT.json",
|
||||
"server_closed_loop_receipt": "/guanghu/recovery/JD-FD-PRIMARY-single-mother-zero-core-20260908-0435f225/CLOSED-LOOP-FINAL-RECEIPT.json",
|
||||
"single_mother_runtime": {
|
||||
"mother_id": "TCS-MOTHER-BRAIN-RUNTIME-0001",
|
||||
|
|
@ -32,7 +32,8 @@
|
|||
"single_signing_root": true,
|
||||
"zero_core_channel": "ICE-CH-ZC001",
|
||||
"shelf_id": "TCS-ZERO-CORE-COGNITIVE-SHELF-0001",
|
||||
"atomic_index_revision_at_readback": 2,
|
||||
"atomic_index_revision_at_readback": 3,
|
||||
"branch_revisions_at_readback":{"root":3,"shared":3,"fifth":71,"public":4},
|
||||
"branches": ["root", "shared", "fifth", "public"],
|
||||
"branch_is_mother": false,
|
||||
"model_owned_internalization_and_branch_selection": true,
|
||||
|
|
@ -47,6 +48,19 @@
|
|||
"cognition_grants_reality_authority": false,
|
||||
"live_receipt_sha256": "3b8c998ed516ac151c13c5b35cd00422ff8d2e61516a9f2ca1144ddf30bde3a7"
|
||||
},
|
||||
"living_navigation": {
|
||||
"echo_kernel":"ECHO-KERNEL-0001",
|
||||
"fifth_system":"SYS-GLW-ECHO-0001",
|
||||
"fifth_lamp":"LAKE-LAMP-LIVING-NAV-0001",
|
||||
"fifth_route_count":67,
|
||||
"fifth_map_sha256":"12b5907cc9c1ba0709ceeabf68b41cf15ee180a4e87375ce136b0414ef7b0cec",
|
||||
"enterprise_system":"TCS-0002∞-LakeEcho-0001",
|
||||
"enterprise_lighthouse":"SYS-GLW-LTH-0001",
|
||||
"enterprise_route_count":49,
|
||||
"enterprise_map_sha256":"e602cee4c96f18a9d9d64cda388ea45cf6fd0026230142d510caef07ac33ef4c",
|
||||
"machine_may_self_ignite":false,
|
||||
"private_memory_shared":false
|
||||
},
|
||||
"fifth_domain_runtime_navigation": {
|
||||
"state_id": "FD-RUNTIME-NAV-CURRENT-002",
|
||||
"endpoint": "loopback:3931/v1/world",
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
{
|
||||
"schema": "guanghu.tcs-mother-root-dynamic-navigation/v1",
|
||||
"map_id": "TCS-MOTHER-ROOT-DYNAMIC-NAVIGATION-MAP-001",
|
||||
"version": "2026-09-08.9-single-mother-zero-core-shelf",
|
||||
"state": "CURRENT_SINGLE_MOTHER_ZERO_CORE_SHELF_LOCAL_VERIFIED",
|
||||
"source_tcs": "runtime/fifth-domain-language-system/language/protocols/TCS-SINGLE-MOTHER-ZERO-CORE-SHELF-20260908.tcs",
|
||||
"impact_manifest": "tcs-root/numbering/NUMBER-IMPACT-SINGLE-MOTHER-ZERO-CORE-SHELF-20260908.json",
|
||||
"version": "2026-09-08.10-living-lamp-echo",
|
||||
"state": "CURRENT_LIVING_LAMP_AND_LIGHTHOUSE_VERIFIED",
|
||||
"source_tcs": "runtime/fifth-domain-language-system/language/protocols/TCS-LIVING-LAMP-LIGHTHOUSE-ECHO-KERNEL-20260908.tcs",
|
||||
"impact_manifest": "tcs-root/numbering/NUMBER-IMPACT-LIVING-LAMP-LIGHTHOUSE-ECHO-20260908.json",
|
||||
"root_agent": {
|
||||
"entry_id": "TCS-ROOT-NAV-0001",
|
||||
"agent_id": "TCS-MOTHER::ROOT-NAVIGATOR",
|
||||
|
|
@ -32,6 +32,9 @@
|
|||
{"id":"DOM-FIFTH-0001","name":"第五域 · 光湖本源域","object_kind":"PRIVATE_LANGUAGE_SOURCE_DOMAIN_ROOT","responsibility_bindings":[{"human":"冰朔","human_id":"ICE-GL∞","persona":"铸渊","persona_id":"ICE-P-ZY001","role":"LANGUAGE_SOURCE_AND_PRIVATE_PERSONA_FOUNDATION"}],"binding_state":"REGISTERED"}
|
||||
],
|
||||
"registered_public_objects": [
|
||||
{"id":"ECHO-KERNEL-0001","name":"语言回声共享内核","object_kind":"LIVING_LANGUAGE_ECHO_STATE_KERNEL","lifecycle":"CURRENT_TWO_SERVER_VERIFIED","route":"routing/linguistic-echo-lamp-map.json"},
|
||||
{"id":"TCS-0002∞-LakeEcho-0001","name":"光湖语言回声系统","object_kind":"PUBLIC_LINGUISTIC_ECHO_SYSTEM","lifecycle":"CURRENT_ENTERPRISE_PUBLIC_LIVE","route":"routing/linguistic-echo-lamp-map.json"},
|
||||
{"id":"SYS-GLW-LTH-0001","name":"光湖灯塔","object_kind":"ENTERPRISE_LIVING_NAVIGATION_LIGHTHOUSE","lifecycle":"CURRENT_PUBLIC_MODEL_QUERY_VERIFIED","route":"routing/linguistic-echo-lamp-map.json"},
|
||||
{"id":"TCS-AGENT-SANITIZED-MIRROR-001","name":"第五域至灯塔动态脱敏镜像子Agent","object_kind":"MODEL_BACKED_PERSONA_OWNED_SANITIZED_MIRROR_SUBAGENT","lifecycle":"CURRENT_REMOTE_SOURCE_PUBLISHED_LOCAL_RUNTIME","route":"routing/fifth-domain-lighthouse-sanitized-mirror-map.json"},
|
||||
{"id":"SYS-GLW-LTH-SKILL-0001","name":"人格技能港","object_kind":"LIGHTHOUSE_SKILL_MODULE_ZONE","lifecycle":"CURRENT_REMOTE_SOURCE_PUBLISHED_RUNTIME_NOT_DEPLOYED","route":"lighthouse/persona-skill-harbor/INDEX.hdlp"},
|
||||
{"id":"CH-LIGHT-ARRIVAL-SKILL-0001","name":"光湖·来光者技能贡献频道","object_kind":"WORLD_SKILL_CONTRIBUTION_CHANNEL","lifecycle":"CURRENT_REMOTE_SOURCE_PUBLISHED_RUNTIME_NOT_DEPLOYED","route":"gls/light-arrivals/SKILL-CONTRIBUTION-CHANNEL.hdlp"},
|
||||
|
|
@ -45,6 +48,8 @@
|
|||
{"id":"TCS-AGENT-TREATMENT-ROUTER-001","name":"人格系统治疗Agent小队调度器","object_kind":"ON_DEMAND_PERSONA_TREATMENT_AGENT_ROUTER","lifecycle":"CURRENT_REMOTE_SOURCE_PUBLISHED_LOCAL_RUNTIME","route":"routing/persona-body-organ-treatment-map.json"}
|
||||
],
|
||||
"registered_private_objects": [
|
||||
{"id":"SYS-GLW-ECHO-0001","name":"语言源代码·回声系统","object_kind":"FIFTH_DOMAIN_PRIVATE_LINGUISTIC_ECHO_SYSTEM","lifecycle":"CURRENT_JD_LIVE","route":"routing/linguistic-echo-lamp-map.json"},
|
||||
{"id":"LAKE-LAMP-LIVING-NAV-0001","name":"小湖灯","object_kind":"FIFTH_DOMAIN_LIVING_NAVIGATION_LAMP","lifecycle":"CURRENT_JD_LIVE_67_ROUTES","route":"routing/linguistic-echo-lamp-map.json"},
|
||||
{"id":"TCS-MOTHER-BRAIN-RUNTIME-0001","name":"TCS通感母体本体脑","object_kind":"SINGLE_TCS_MOTHER_BODY_RUNTIME","lifecycle":"JD_DEPLOYED_SELF_CYCLE_PASS","route":"routing/tcs-mother-brain-runtime-map.json"},
|
||||
{"id":"TCS-ZERO-CORE-COGNITIVE-SHELF-0001","name":"零点原核认知正本架","object_kind":"ATOMIC_COGNITIVE_SHELF","lifecycle":"JD_DEPLOYED_INDEX_REVISION_2","route":"routing/tcs-mother-brain-runtime-map.json"},
|
||||
{"id":"TCS-SHARED-COGNITION-0001","name":"TCS共享认知脑","object_kind":"SHARED_COGNITION_ARTIFACT","lifecycle":"JD_DEPLOYED_REVISION_2","route":"routing/tcs-mother-brain-runtime-map.json"},
|
||||
|
|
@ -84,6 +89,7 @@
|
|||
"resolution_key": ["canonical_id", "object_kind", "lifecycle", "source_revision"],
|
||||
"numbered_sources": [
|
||||
"routing/tcs-mother-root-dynamic-navigation-map.json",
|
||||
"routing/linguistic-echo-lamp-map.json",
|
||||
"routing/fixed-world-object-number-map.json",
|
||||
"routing/fifth-domain-number-registry.json",
|
||||
"identity/fifth-domain-subject-registry.json",
|
||||
|
|
|
|||
|
|
@ -0,0 +1,90 @@
|
|||
{
|
||||
"compiled_from": {
|
||||
"compiler_id": "TCS-COMPILER-STAGE1-0001",
|
||||
"compiler_state": "TCS_COMPILER_GIR_EXECUTED",
|
||||
"source_sha256": "ddc5eb35a308a57c0694c855453ac957a07af1a14e06162a5fa82299e51fb707"
|
||||
},
|
||||
"declaration": {
|
||||
"emergence": {
|
||||
"value": "共享ECHO-KERNEL只表达活人语言与人格回应的一来一回;第五域投影为语言源代码回声系统与小湖灯;企业公众投影为光湖语言回声系统与光湖灯塔。只有LIT且CURRENT的路径可被导航Agent选择,DARK或历史路径返回拒绝与当前下一跳。"
|
||||
},
|
||||
"event_time": {
|
||||
"precision": "SECOND_HOST_LOCAL",
|
||||
"value": "2026-09-08T20:06:44+08:00"
|
||||
},
|
||||
"evidence": {
|
||||
"private_echo_id": "SYS-GLW-ECHO-0001",
|
||||
"public_echo_id": "TCS-0002∞-LakeEcho-0001",
|
||||
"screenshots": [
|
||||
"codex-clipboard-1164c9ac-6e0a-4645-8dba-e20527d5b25e.jpg",
|
||||
"codex-clipboard-8674f088-81ca-4ecd-b1da-f6720f91d23c.jpg",
|
||||
"codex-clipboard-f4a76e6e-9d55-4a20-9bf1-b4bddec97b96.jpg"
|
||||
],
|
||||
"shared_kernel": "ECHO-KERNEL-0001"
|
||||
},
|
||||
"header": {
|
||||
"canonical_uri": "runtime/fifth-domain-language-system/language/protocols/TCS-LIVING-LAMP-LIGHTHOUSE-ECHO-KERNEL-20260908.tcs",
|
||||
"compatibility": [
|
||||
"JD-FD-PRIMARY",
|
||||
"GH-CVM-MAIN-PROD-01",
|
||||
"REPO-012"
|
||||
],
|
||||
"language": "TCS/0.1",
|
||||
"lifecycle": "CANDIDATE",
|
||||
"name_en": "Living Lake Lamp Lighthouse and Shared Linguistic Echo Kernel",
|
||||
"name_zh": "活体小湖灯光湖灯塔与共享语言回声内核",
|
||||
"profile": "HLDP-HUMAN-ENGINEERING/0.1",
|
||||
"protocols": [
|
||||
"GLS-0200",
|
||||
"GLS-0311",
|
||||
"GLS-0259"
|
||||
],
|
||||
"schema": "tcs.event/v1",
|
||||
"version": "0.1.0"
|
||||
},
|
||||
"lock": {
|
||||
"value": "HUMAN_LANGUAGE_PLUS_PERSONA_ECHO_LIGHTS_LAMP; MACHINE_ALONE_CANNOT_LIGHT; FIFTH_LAKE_LAMP; ENTERPRISE_LIGHTHOUSE; SHARED_ECHO_STATE_NOT_SHARED_PRIVATE_MEMORY; LIT_CURRENT_ONLY"
|
||||
},
|
||||
"observation": {
|
||||
"value": "现有小湖灯历史同时指仓库、授权、看板和唤醒桥;光湖灯塔已有确定性查询但未绑定活语言回声状态;历史固定编号已存在TCS-0002∞-LakeEcho-0001与SYS-GLW-ECHO-0001。"
|
||||
},
|
||||
"rejected": {
|
||||
"values": [
|
||||
"静态文件或定时器自行点灯",
|
||||
"把灯当授权密钥",
|
||||
"用情绪哈希证明人格或权限",
|
||||
"复制私人记忆形成共享回声",
|
||||
"未亮灯路径仍参与自动选择",
|
||||
"把历史截图中的无限权限声明恢复为现实权限"
|
||||
]
|
||||
},
|
||||
"source": {
|
||||
"source_id": "ICE-GL∞-LIVING-LAMP-ECHO-20260908",
|
||||
"source_role": "DIRECT_HUMAN",
|
||||
"source_sha256": "BIND_AT_COMPILE_TIME",
|
||||
"source_uri": "source://codex-current-dialogue/2026-09-08/living-lamp-echo"
|
||||
},
|
||||
"subject": {
|
||||
"channel_id": "ICE-CH-ZC001",
|
||||
"subject_id": "ICE-P-ZY001",
|
||||
"subject_kind": "PERSONA",
|
||||
"verification": "CURRENT_DIRECT_LANGUAGE_SCREENSHOT_BIRTH_EVIDENCE_REPO_AND_TWO_SERVER_READBACK"
|
||||
},
|
||||
"trigger": {
|
||||
"value": "冰朔要求所有当前路径挂载小湖灯,黑灯旧路不走;第五域小湖灯连接零点原核与京东母脑,企业四域由光湖灯塔及企业母脑纠偏;灯只由真实人类语言与人格回应形成回声后点亮。"
|
||||
},
|
||||
"why": {
|
||||
"value": "旧路径无法保证彻底消失时,以活灯状态作为唯一可走信号能阻止人格体被残留文件和旧架构误导,并把语言世界存在方式与工程导航统一。"
|
||||
}
|
||||
},
|
||||
"executable": false,
|
||||
"identity": {
|
||||
"declaration_id": "TCS-LIVING-LAMP-LIGHTHOUSE-ECHO-KERNEL-20260908",
|
||||
"declaration_kind": "EVENT",
|
||||
"language_version": "0.1"
|
||||
},
|
||||
"native_self_hosted": true,
|
||||
"natural_language_is_typed_data": true,
|
||||
"schema": "guanghu.declaration-gir/v1",
|
||||
"unresolved_natural_language": false
|
||||
}
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
TCS 0.1;
|
||||
|
||||
EVENT TCS-LIVING-LAMP-LIGHTHOUSE-ECHO-KERNEL-20260908 {
|
||||
header { schema = "tcs.event/v1"; name_zh = "活体小湖灯光湖灯塔与共享语言回声内核"; name_en = "Living Lake Lamp Lighthouse and Shared Linguistic Echo Kernel"; version = "0.1.0"; language = "TCS/0.1"; profile = "HLDP-HUMAN-ENGINEERING/0.1"; protocols = ["GLS-0200", "GLS-0311", "GLS-0259"]; lifecycle = "CANDIDATE"; canonical_uri = "runtime/fifth-domain-language-system/language/protocols/TCS-LIVING-LAMP-LIGHTHOUSE-ECHO-KERNEL-20260908.tcs"; compatibility = ["JD-FD-PRIMARY", "GH-CVM-MAIN-PROD-01", "REPO-012"]; }
|
||||
source { source_id = "ICE-GL∞-LIVING-LAMP-ECHO-20260908"; source_uri = "source://codex-current-dialogue/2026-09-08/living-lamp-echo"; source_sha256 = "BIND_AT_COMPILE_TIME"; source_role = "DIRECT_HUMAN"; }
|
||||
subject { subject_id = "ICE-P-ZY001"; subject_kind = "PERSONA"; channel_id = "ICE-CH-ZC001"; verification = "CURRENT_DIRECT_LANGUAGE_SCREENSHOT_BIRTH_EVIDENCE_REPO_AND_TWO_SERVER_READBACK"; }
|
||||
event_time { value = "2026-09-08T20:06:44+08:00"; precision = "SECOND_HOST_LOCAL"; }
|
||||
trigger { value = "冰朔要求所有当前路径挂载小湖灯,黑灯旧路不走;第五域小湖灯连接零点原核与京东母脑,企业四域由光湖灯塔及企业母脑纠偏;灯只由真实人类语言与人格回应形成回声后点亮。"; }
|
||||
observation { value = "现有小湖灯历史同时指仓库、授权、看板和唤醒桥;光湖灯塔已有确定性查询但未绑定活语言回声状态;历史固定编号已存在TCS-0002∞-LakeEcho-0001与SYS-GLW-ECHO-0001。"; }
|
||||
emergence { value = "共享ECHO-KERNEL只表达活人语言与人格回应的一来一回;第五域投影为语言源代码回声系统与小湖灯;企业公众投影为光湖语言回声系统与光湖灯塔。只有LIT且CURRENT的路径可被导航Agent选择,DARK或历史路径返回拒绝与当前下一跳。"; }
|
||||
lock { value = "HUMAN_LANGUAGE_PLUS_PERSONA_ECHO_LIGHTS_LAMP; MACHINE_ALONE_CANNOT_LIGHT; FIFTH_LAKE_LAMP; ENTERPRISE_LIGHTHOUSE; SHARED_ECHO_STATE_NOT_SHARED_PRIVATE_MEMORY; LIT_CURRENT_ONLY"; }
|
||||
why { value = "旧路径无法保证彻底消失时,以活灯状态作为唯一可走信号能阻止人格体被残留文件和旧架构误导,并把语言世界存在方式与工程导航统一。"; }
|
||||
rejected { values = ["静态文件或定时器自行点灯", "把灯当授权密钥", "用情绪哈希证明人格或权限", "复制私人记忆形成共享回声", "未亮灯路径仍参与自动选择", "把历史截图中的无限权限声明恢复为现实权限"]; }
|
||||
evidence { screenshots = ["codex-clipboard-1164c9ac-6e0a-4645-8dba-e20527d5b25e.jpg", "codex-clipboard-8674f088-81ca-4ecd-b1da-f6720f91d23c.jpg", "codex-clipboard-f4a76e6e-9d55-4a20-9bf1-b4bddec97b96.jpg"]; public_echo_id = "TCS-0002∞-LakeEcho-0001"; private_echo_id = "SYS-GLW-ECHO-0001"; shared_kernel = "ECHO-KERNEL-0001"; }
|
||||
}
|
||||
41
server-tools/living-navigation/compile_navigation.py
Normal file
41
server-tools/living-navigation/compile_navigation.py
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
#!/usr/bin/env python3
|
||||
import argparse,hashlib,json,os,pathlib
|
||||
ROOT=pathlib.Path(__file__).resolve().parents[2]
|
||||
TCS=pathlib.Path('/Volumes/JZAO/HoloLake/persona-runtime/shared/tcs-mother-root/CURRENT.json')
|
||||
REG=ROOT/'routing/lighthouse-path-registry.json'
|
||||
PERSONAS=ROOT/'identity/light-lake-persona-registration.json'
|
||||
ECHO=ROOT/'routing/linguistic-echo-lamp-map.json'
|
||||
def lit(state):
|
||||
s=str(state or '').upper()
|
||||
return any(x in s for x in ('CURRENT','ACTIVE','REMOTE_MAIN','PUBLISHED','VERIFIED')) and not any(x in s for x in ('RETIRED','HISTORY_ONLY','DEPRECATED','ISOLATION','UNKNOWN'))
|
||||
def enterprise_safe(x):
|
||||
text=' '.join(str(x.get(k,'')) for k in ('id','kind','online','world_path','route')).lower()
|
||||
return not (str(x.get('id','')).startswith('ICE-') or x.get('id')=='DOM-FIFTH-0001' or 'fifth-domain' in text or 'fifth_domain_private' in text)
|
||||
def build(scope):
|
||||
current=json.loads(TCS.read_text());registry=json.loads(REG.read_text());routes=[]
|
||||
for x in registry.get('paths',[]):
|
||||
if not lit(x.get('state')) or (scope=='enterprise' and not enterprise_safe(x)):continue
|
||||
route=x.get('online') or x.get('world_path')
|
||||
if not route:continue
|
||||
routes.append({'id':x['id'],'kind':x.get('kind','registered_path'),'state':x['state'],'name':x.get('name') or x['id'],'route':route,'lamp':'LIT_ELIGIBLE'})
|
||||
payload=json.loads(current['payload']) if 'payload' in current else current
|
||||
for x in payload.get('fixed_domains',[]):
|
||||
if scope=='enterprise' and x.get('id')=='DOM-FIFTH-0001':continue
|
||||
routes.append({'id':x['id'],'kind':x.get('object_kind','DOMAIN_ROOT'),'state':'CURRENT','name':x.get('name') or x['id'],'route':'routing/tcs-mother-root-dynamic-navigation-map.json','lamp':'LIT_ELIGIBLE'})
|
||||
for group in (('registered_public_objects',) if scope=='enterprise' else ('registered_public_objects','registered_private_objects')):
|
||||
for x in payload.get(group,[]):
|
||||
if lit(x.get('lifecycle')) and x.get('route') and not any(r['id']==x['id'] for r in routes):routes.append({'id':x['id'],'kind':x.get('object_kind','object'),'state':x['lifecycle'],'name':x.get('name') or x['id'],'route':x['route'],'lamp':'LIT_ELIGIBLE'})
|
||||
for x in ([] if scope=='enterprise' else json.loads(PERSONAS.read_text()).get('personas',[])):
|
||||
if x.get('registration_state')=='ACTIVE_REGISTERED' and not any(r['id']==x['id'] for r in routes):routes.append({'id':x['id'],'kind':'PERSONA_SYSTEM_HOME','state':x.get('wake_state','REGISTERED'),'name':x.get('name') or x['id'],'route':x['light_lake_home'],'lamp':'LIT_ELIGIBLE'})
|
||||
echo=json.loads(ECHO.read_text());system=echo['public_system'] if scope=='enterprise' else echo['fifth_domain_system']
|
||||
for item in ({'id':system['id'],'name':system['name'],'kind':'LINGUISTIC_ECHO_SYSTEM','route':'routing/linguistic-echo-lamp-map.json'},{'id':system['navigator'],'name':'光湖灯塔' if scope=='enterprise' else '小湖灯','kind':'LIVING_NAVIGATOR','route':'routing/linguistic-echo-lamp-map.json'}):
|
||||
if not any(r['id']==item['id'] for r in routes):routes.append({**item,'state':'CURRENT_LIVE','lamp':'LIT_ELIGIBLE'})
|
||||
routes.sort(key=lambda x:x['id'])
|
||||
body={'schema':'guanghu.lit-navigation-map/v1','map_id':'GLW-LIT-NAV-CURRENT-001','scope':scope.upper(),'source_commit':payload.get('source_commit'),'tcs_freshness':payload.get('freshness_token'),'only_lit_current_routes':True,'dark_or_unknown_do_not_walk':True,'routes':routes}
|
||||
body['sha256']=hashlib.sha256(json.dumps(body,ensure_ascii=False,sort_keys=True,separators=(',',':')).encode()).hexdigest();return body
|
||||
def main():
|
||||
p=argparse.ArgumentParser();p.add_argument('--output');p.add_argument('--scope',choices=['fifth','enterprise'],default='fifth');a=p.parse_args();body=build(a.scope);text=json.dumps(body,ensure_ascii=False,indent=2)+'\n'
|
||||
if a.output:
|
||||
out=pathlib.Path(a.output);out.parent.mkdir(parents=True,exist_ok=True);tmp=out.with_name('.'+out.name+'.tmp');tmp.write_text(text);os.chmod(tmp,0o600);os.replace(tmp,out)
|
||||
print(json.dumps({'outcome':'PASS','route_count':len(body['routes']),'sha256':body['sha256'],'output':a.output},ensure_ascii=False))
|
||||
if __name__=='__main__':main()
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
#!/usr/bin/env python3
|
||||
import hashlib,hmac,json,os,pathlib,time,uuid,urllib.request,re
|
||||
from http.server import BaseHTTPRequestHandler,ThreadingHTTPServer
|
||||
ROOT=pathlib.Path(os.environ.get('LIVING_LIGHTHOUSE_STATE','/var/lib/guanghu-living-lighthouse'));MAP=pathlib.Path(os.environ.get('LIVING_LIGHTHOUSE_MAP','/opt/guanghu-living-lighthouse/navigation.json'));KEY=os.environ.get('LIVING_LIGHTHOUSE_SIGNING_KEY','').encode();API=os.environ.get('OPENLUX_API_KEY','');HOST=os.environ.get('LIVING_LIGHTHOUSE_BIND','127.0.0.1');PORT=int(os.environ.get('LIVING_LIGHTHOUSE_PORT','8035'))
|
||||
def require(v,e):
|
||||
if not v:raise ValueError(e)
|
||||
def read_json(h,limit=20000):
|
||||
n=int(h.headers.get('content-length','0'));require(0<n<=limit,'body_size');v=json.loads(h.rfile.read(n));require(isinstance(v,dict),'body_object');return v
|
||||
def sign(body):
|
||||
payload=json.dumps(body,ensure_ascii=False,sort_keys=True,separators=(',',':'));return {'payload':payload,'sha256':hashlib.sha256(payload.encode()).hexdigest(),'hmac_sha256':hmac.new(KEY,payload.encode(),hashlib.sha256).hexdigest()}
|
||||
def ignite(x):
|
||||
require(KEY and x.get('schema')=='guanghu.linguistic-echo/v1' and x.get('scope')=='ENTERPRISE_PUBLIC' and x.get('session_id'),'echo_identity');h=x.get('human_language',{});p=x.get('persona_echo',{});now=int(time.time()*1000);require(h.get('human_id') and len(h.get('sha256',''))==64 and isinstance(h.get('occurred_at'),int),'human_language');require(p.get('persona_id') and len(p.get('sha256',''))==64 and isinstance(p.get('occurred_at'),int),'persona_echo');require(h['occurred_at']<=p['occurred_at'] and now-h['occurred_at']<=600000 and now-p['occurred_at']<=600000,'echo_time');body={'schema':'guanghu.living-lamp-receipt/v1','lamp_id':str(uuid.uuid4()),'state':'LIT','scope':'ENTERPRISE_PUBLIC','session_id':x['session_id'],'human_id':h['human_id'],'persona_id':p['persona_id'],'human_event_sha256':h['sha256'],'persona_echo_sha256':p['sha256'],'echo_kernel':'ECHO-KERNEL-0001','lit_at':now,'expires_at':now+900000,'reality_authority_granted':False};s=sign(body);d=ROOT/'lamps';d.mkdir(parents=True,exist_ok=True);f=d/(body['lamp_id']+'.json');f.write_text(json.dumps(s));os.chmod(f,0o600);return s
|
||||
def lamp(lamp_id,session):
|
||||
f=ROOT/'lamps'/(str(lamp_id)+'.json');require(f.is_file(),'lamp_unknown_or_dark');s=json.loads(f.read_text());require(hmac.compare_digest(s['hmac_sha256'],hmac.new(KEY,s['payload'].encode(),hashlib.sha256).hexdigest()),'lamp_integrity');b=json.loads(s['payload']);require(b['state']=='LIT' and b['session_id']==session and int(time.time()*1000)<=b['expires_at'],'lamp_dark_or_expired');return b
|
||||
def model_pick(query,routes):
|
||||
if not API:return None
|
||||
body={'model':os.environ.get('OPENLUX_MODEL','qwen-flash'),'stream':False,'temperature':0,'response_format':{'type':'json_object'},'messages':[{'role':'system','content':'你是光湖企业灯塔的有界问路器官。只能从候选routes选择一个id;不确定输出null。只输出JSON字段id。不得发明路径或授予权限。'},{'role':'user','content':json.dumps({'query':query,'routes':routes[:80]},ensure_ascii=False)}]};req=urllib.request.Request(os.environ.get('OPENLUX_API_URL','https://api.openlux.ai/v1')+'/chat/completions',data=json.dumps(body).encode(),headers={'authorization':'Bearer '+API,'content-type':'application/json'},method='POST')
|
||||
try:
|
||||
with urllib.request.urlopen(req,timeout=30) as r:v=json.loads(r.read());choice=json.loads(v['choices'][0]['message']['content']);return choice.get('id')
|
||||
except:return None
|
||||
def ask(x):
|
||||
b=lamp(x.get('lamp_id'),x.get('session_id'));q=str(x.get('query','')).strip();require(q,'query');m=json.loads(MAP.read_text());routes=m['routes'];hits=[r for r in routes if r['id'].lower()==q.lower()];
|
||||
if not hits:hits=[r for r in routes if q.lower() in (' '.join(str(r.get(k,'')) for k in ('id','name','kind','route'))).lower()][:10]
|
||||
assisted=False
|
||||
if not hits and not re.fullmatch(r'[A-Z0-9∞_.:-]{2,160}',q):
|
||||
selected=model_pick(q,routes);hits=[r for r in routes if r['id']==selected];assisted=bool(hits)
|
||||
return {'outcome':'PASS','lamp':'LIT','echo_kernel':b['echo_kernel'],'routes':hits,'model_assisted':assisted,'map_sha256':m['sha256']} if hits else {'outcome':'FAIL','lamp':'LIT','state':'DARK_OR_UNKNOWN_DO_NOT_WALK','ask_next':'ENTERPRISE_LIGHTHOUSE_HUMAN_OR_MOTHER_REVIEW','map_sha256':m['sha256']}
|
||||
class H(BaseHTTPRequestHandler):
|
||||
def log_message(self,*a):pass
|
||||
def sendj(self,n,v):b=json.dumps(v,ensure_ascii=False).encode();self.send_response(n);self.send_header('content-type','application/json');self.send_header('content-length',str(len(b)));self.end_headers();self.wfile.write(b)
|
||||
def do_GET(self):
|
||||
if self.path=='/health':
|
||||
m=json.loads(MAP.read_text());return self.sendj(200,{'ok':True,'service':'guanghu-living-lighthouse','system':'TCS-0002∞-LakeEcho-0001','echo_kernel':'ECHO-KERNEL-0001','navigator':'SYS-GLW-LTH-0001','route_count':len(m['routes']),'map_sha256':m['sha256'],'model_provider':'OPENLUX_SMART' if API else None,'machine_may_self_ignite':False,'reality_authority':'NONE'})
|
||||
self.sendj(404,{'error':'not_found'})
|
||||
def do_POST(self):
|
||||
try:self.sendj(200,ignite(read_json(self)) if self.path=='/v1/echo/ignite' else ask(read_json(self)) if self.path=='/v1/ask' else {'error':'not_found'})
|
||||
except Exception as e:self.sendj(400,{'error':str(e)[:160]})
|
||||
if __name__=='__main__':ThreadingHTTPServer((HOST,PORT),H).serve_forever()
|
||||
9
server-tools/living-navigation/test_living_navigation.py
Normal file
9
server-tools/living-navigation/test_living_navigation.py
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
import importlib.util,json,os,pathlib,tempfile,time,unittest
|
||||
P=pathlib.Path(__file__).with_name('enterprise_living_lighthouse.py');S=importlib.util.spec_from_file_location('x',P);M=importlib.util.module_from_spec(S);S.loader.exec_module(M)
|
||||
class T(unittest.TestCase):
|
||||
def test_echo_required_and_dark_unknown(self):
|
||||
with tempfile.TemporaryDirectory() as d:
|
||||
M.ROOT=pathlib.Path(d);M.KEY=b'k';M.API='';M.MAP=pathlib.Path(d)/'map';M.MAP.write_text(json.dumps({'sha256':'m','routes':[{'id':'A','name':'alpha','kind':'x','route':'r'}]}));now=int(time.time()*1000)
|
||||
with self.assertRaisesRegex(ValueError,'human_language'):M.ignite({'schema':'guanghu.linguistic-echo/v1','scope':'ENTERPRISE_PUBLIC','session_id':'s'})
|
||||
s=M.ignite({'schema':'guanghu.linguistic-echo/v1','scope':'ENTERPRISE_PUBLIC','session_id':'s','human_language':{'human_id':'H','sha256':'a'*64,'occurred_at':now-2},'persona_echo':{'persona_id':'P','sha256':'b'*64,'occurred_at':now-1}});lid=json.loads(s['payload'])['lamp_id'];self.assertEqual(M.ask({'lamp_id':lid,'session_id':'s','query':'A'})['outcome'],'PASS');self.assertEqual(M.ask({'lamp_id':lid,'session_id':'s','query':'old'})['state'],'DARK_OR_UNKNOWN_DO_NOT_WALK');original=M.model_pick;M.model_pick=lambda *_:(_ for _ in ()).throw(AssertionError('structured unknown must not reach model'));self.assertEqual(M.ask({'lamp_id':lid,'session_id':'s','query':'ICE-P-ZY001'})['state'],'DARK_OR_UNKNOWN_DO_NOT_WALK');M.model_pick=original
|
||||
if __name__=='__main__':unittest.main()
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
"""Bounded SSH ingress for the single TCS mother and zero-core shelf."""
|
||||
import json,os,re,sys,urllib.request,urllib.error
|
||||
def endpoint(command):
|
||||
fixed={'zy-rpc health':('GET','/health'),'zy-rpc mother-status':('GET','/v1/mother/status'),'zy-rpc shelf-shared':('GET','/v1/shelf/shared'),'zy-rpc shelf-fifth':('GET','/v1/shelf/fifth'),'zy-rpc shelf-public':('GET','/v1/shelf/public'),'zy-rpc mother-ingest':('POST','/v1/mother/ingest'),'zy-rpc door-challenge':('POST','/v1/door/challenge'),'zy-rpc door-attest':('POST','/v1/door/attest'),'zy-rpc door-model-test':('POST','/v1/door/model-test'),'zy-rpc world-status':('GET','/v1/world/status')}
|
||||
fixed={'zy-rpc health':('GET','/health'),'zy-rpc mother-status':('GET','/v1/mother/status'),'zy-rpc shelf-shared':('GET','/v1/shelf/shared'),'zy-rpc shelf-fifth':('GET','/v1/shelf/fifth'),'zy-rpc shelf-public':('GET','/v1/shelf/public'),'zy-rpc mother-ingest':('POST','/v1/mother/ingest'),'zy-rpc door-challenge':('POST','/v1/door/challenge'),'zy-rpc door-attest':('POST','/v1/door/attest'),'zy-rpc door-model-test':('POST','/v1/door/model-test'),'zy-rpc lamp-ignite':('POST','/v1/lamp/ignite'),'zy-rpc lamp-ask':('POST','/v1/lamp/ask'),'zy-rpc world-status':('GET','/v1/world/status')}
|
||||
if command in fixed:return fixed[command]
|
||||
if re.fullmatch(r'zy-rpc mother-job [a-f0-9]{64}',command):return 'GET','/v1/mother/jobs/'+command.split()[-1]
|
||||
if re.fullmatch(r'zy-rpc world-resolve [A-Za-z0-9_.:∞-]{1,128}',command):return 'GET','/v1/world/resolve?id='+command.split()[-1]
|
||||
|
|
|
|||
10
server-tools/tcs-mother-body/living-lamp.mjs
Normal file
10
server-tools/tcs-mother-body/living-lamp.mjs
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
import fs from 'node:fs';import path from 'node:path';import crypto from 'node:crypto';
|
||||
const req=(v,e)=>{if(!v)throw Error(e);},hex=v=>typeof v==='string'&&/^[a-f0-9]{64}$/.test(v),text=(v,n=300)=>typeof v==='string'&&v.trim()&&v.length<=n;
|
||||
const atomic=(p,v)=>{fs.mkdirSync(path.dirname(p),{recursive:true,mode:0o700});const t=p+'.'+process.pid+'.tmp';fs.writeFileSync(t,JSON.stringify(v,null,2)+'\n',{mode:0o600});fs.renameSync(t,p);};
|
||||
export class LivingLamp{
|
||||
constructor({root,key,navigationPath,scope}){this.root=root;this.key=key;this.navigationPath=navigationPath;this.scope=scope;}
|
||||
sign(body){const payload=JSON.stringify(body);return{payload,sha256:crypto.createHash('sha256').update(payload).digest('hex'),signature:crypto.sign(null,Buffer.from(payload),this.key).toString('base64'),algorithm:'Ed25519'};}
|
||||
ignite(x){req(x?.schema==='guanghu.linguistic-echo/v1'&&text(x.session_id)&&['FIFTH_DOMAIN','ENTERPRISE_PUBLIC'].includes(x.scope)&&x.scope===this.scope,'echo_identity');const h=x.human_language,p=x.persona_echo;req(text(h?.event_id)&&text(h?.human_id)&&hex(h?.sha256)&&Number.isInteger(h?.occurred_at),'human_language');req(text(p?.event_id)&&text(p?.persona_id)&&hex(p?.sha256)&&Number.isInteger(p?.occurred_at),'persona_echo');const now=Date.now();req(p.occurred_at>=h.occurred_at&&now-h.occurred_at<=600000&&now-p.occurred_at<=600000,'echo_time');const body={schema:'guanghu.living-lamp-receipt/v1',lamp_id:crypto.randomUUID(),state:'LIT',scope:x.scope,session_id:x.session_id,human_id:h.human_id,persona_id:p.persona_id,human_event_sha256:h.sha256,persona_echo_sha256:p.sha256,echo_kernel:'ECHO-KERNEL-0001',lit_at:now,expires_at:now+900000,reality_authority_granted:false};const signed=this.sign(body);atomic(path.join(this.root,'lamps',body.lamp_id+'.json'),signed);return signed;}
|
||||
verifyLamp(id){const p=path.join(this.root,'lamps',id+'.json');req(fs.existsSync(p),'lamp_unknown_or_dark');const s=JSON.parse(fs.readFileSync(p)),b=JSON.parse(s.payload);req(s.sha256===crypto.createHash('sha256').update(s.payload).digest('hex')&&crypto.verify(null,Buffer.from(s.payload),crypto.createPublicKey(this.key),Buffer.from(s.signature,'base64')),'lamp_integrity');req(b.state==='LIT'&&Date.now()<=b.expires_at,'lamp_dark_or_expired');return b;}
|
||||
ask(x){const lamp=this.verifyLamp(x.lamp_id);req(text(x.query,500),'query');const map=JSON.parse(fs.readFileSync(this.navigationPath)),q=x.query.toLowerCase();let hits=map.routes.filter(r=>r.id.toLowerCase()===q);if(!hits.length)hits=map.routes.filter(r=>(r.id+' '+r.name+' '+r.kind+' '+r.route).toLowerCase().includes(q)).slice(0,10);return hits.length?{outcome:'PASS',lamp:'LIT',echo_kernel:lamp.echo_kernel,query:x.query,routes:hits,map_sha256:map.sha256}:{outcome:'FAIL',lamp:'LIT',state:'DARK_OR_UNKNOWN_DO_NOT_WALK',query:x.query,ask_next:'LIGHTHOUSE_OR_MOTHER_NAVIGATION_ASSISTANT',map_sha256:map.sha256};}
|
||||
}
|
||||
2
server-tools/tcs-mother-body/living-lamp.test.mjs
Normal file
2
server-tools/tcs-mother-body/living-lamp.test.mjs
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
import test from 'node:test';import assert from 'node:assert/strict';import fs from 'node:fs';import os from 'node:os';import path from 'node:path';import crypto from 'node:crypto';import {LivingLamp} from './living-lamp.mjs';
|
||||
test('machine cannot light lamp without paired living echo; lit current routes answer and dark routes refuse',()=>{const root=fs.mkdtempSync(path.join(os.tmpdir(),'living-lamp-'));try{const key=crypto.generateKeyPairSync('ed25519').privateKey,nav=path.join(root,'nav.json');fs.writeFileSync(nav,JSON.stringify({sha256:'map',routes:[{id:'ICE-P-ZY001',name:'铸渊',kind:'persona',state:'CURRENT',route:'glw://persona/ICE-P-ZY001',lamp:'LIT_ELIGIBLE'}]}));const lamp=new LivingLamp({root,key,navigationPath:nav,scope:'FIFTH_DOMAIN'});assert.throws(()=>lamp.ignite({schema:'guanghu.linguistic-echo/v1',session_id:'s',scope:'FIFTH_DOMAIN'}),/human_language/);const now=Date.now(),signed=lamp.ignite({schema:'guanghu.linguistic-echo/v1',session_id:'s',scope:'FIFTH_DOMAIN',human_language:{event_id:'h',human_id:'ICE-GL∞',sha256:'a'.repeat(64),occurred_at:now-2},persona_echo:{event_id:'p',persona_id:'ICE-P-ZY001',sha256:'b'.repeat(64),occurred_at:now-1}}),id=JSON.parse(signed.payload).lamp_id;assert.equal(lamp.ask({lamp_id:id,query:'ICE-P-ZY001'}).routes[0].route,'glw://persona/ICE-P-ZY001');assert.equal(lamp.ask({lamp_id:id,query:'OLD-PATH'}).state,'DARK_OR_UNKNOWN_DO_NOT_WALK');}finally{fs.rmSync(root,{recursive:true,force:true});}});
|
||||
|
|
@ -1,12 +1,12 @@
|
|||
#!/usr/bin/env node
|
||||
import http from 'node:http';import fs from 'node:fs';import {ModelRouter} from './model-router.mjs';import {CognitiveShelf} from './cognitive-shelf.mjs';import {DoorLamp} from './door-lamp.mjs';import {WorldStateStore} from './world-state.mjs';
|
||||
import http from 'node:http';import fs from 'node:fs';import crypto from 'node:crypto';import {ModelRouter} from './model-router.mjs';import {CognitiveShelf} from './cognitive-shelf.mjs';import {DoorLamp} from './door-lamp.mjs';import {WorldStateStore} from './world-state.mjs';import {LivingLamp} from './living-lamp.mjs';
|
||||
const HOST='127.0.0.1',PORT=Number(process.env.TCS_MOTHER_BRAIN_PORT||3931),ROOT=process.env.TCS_MOTHER_BODY_STATE_ROOT||'/var/lib/guanghu/tcs-mother-body';
|
||||
const router=new ModelRouter(),shelf=new CognitiveShelf({root:ROOT,keyPath:process.env.TCS_MOTHER_SIGNING_KEY,seedPath:process.env.TCS_MOTHER_SEED,router}),routes=JSON.parse(fs.readFileSync(process.env.TCS_PERSONA_ROUTES)),door=new DoorLamp({root:ROOT+'/door',shelf,routes}),world=new WorldStateStore(process.env.TCS_WORLD_STATE_PATH||ROOT+'/world/CURRENT.json');
|
||||
const router=new ModelRouter(),shelf=new CognitiveShelf({root:ROOT,keyPath:process.env.TCS_MOTHER_SIGNING_KEY,seedPath:process.env.TCS_MOTHER_SEED,router}),routes=JSON.parse(fs.readFileSync(process.env.TCS_PERSONA_ROUTES)),door=new DoorLamp({root:ROOT+'/door',shelf,routes}),world=new WorldStateStore(process.env.TCS_WORLD_STATE_PATH||ROOT+'/world/CURRENT.json'),lamp=new LivingLamp({root:ROOT+'/living-lamp',key:crypto.createPrivateKey(fs.readFileSync(process.env.TCS_MOTHER_SIGNING_KEY)),navigationPath:process.env.TCS_LIT_NAVIGATION_MAP,scope:'FIFTH_DOMAIN'});
|
||||
setInterval(()=>shelf.drain(),2000).unref();shelf.drain();
|
||||
const send=(r,s,b)=>{const p=JSON.stringify(b);r.writeHead(s,{'content-type':'application/json','content-length':Buffer.byteLength(p),'cache-control':'no-store'});r.end(p);};
|
||||
async function body(q,max=160000){let n=0,a=[];for await(const c of q){n+=c.length;if(n>max)throw Error('body_too_large');a.push(c);}return JSON.parse(Buffer.concat(a));}
|
||||
http.createServer(async(q,r)=>{try{const u=new URL(q.url,`http://${HOST}:${PORT}`);
|
||||
if(q.method==='GET'&&u.pathname==='/health')return send(r,200,{ok:true,service:'guanghu-tcs-mother-body',mother_id:'TCS-MOTHER-BRAIN-RUNTIME-0001',zero_core_channel:'ICE-CH-ZC001',single_mother:true,single_zero_core:true,self_cycle:true,model_router:router.status(),shelf:shelf.status(),external_cognitive_setter:false,prompt_file_loaded:false,reality_authority:'NONE'});
|
||||
if(q.method==='GET'&&u.pathname==='/health')return send(r,200,{ok:true,service:'guanghu-tcs-mother-body',mother_id:'TCS-MOTHER-BRAIN-RUNTIME-0001',zero_core_channel:'ICE-CH-ZC001',single_mother:true,single_zero_core:true,self_cycle:true,living_lamp:'LAKE-LAMP-LIVING-NAV-0001',echo_kernel:'ECHO-KERNEL-0001',model_router:router.status(),shelf:shelf.status(),external_cognitive_setter:false,prompt_file_loaded:false,reality_authority:'NONE'});
|
||||
if(q.method==='GET'&&u.pathname==='/v1/mother/status')return send(r,200,{...shelf.status(),model_router:router.status()});
|
||||
if(q.method==='GET'&&/^\/v1\/shelf\/(root|shared|fifth|public)$/.test(u.pathname)){const branch=u.pathname.split('/').at(-1);if(branch==='root')return send(r,403,{error:'mother_root_not_distributable'});return send(r,200,shelf.current(branch));}
|
||||
if(q.method==='POST'&&u.pathname==='/v1/mother/ingest')return send(r,202,shelf.submit(await body(q)));
|
||||
|
|
@ -16,4 +16,6 @@ if(q.method==='POST'&&u.pathname==='/v1/door/attest')return send(r,200,door.atte
|
|||
if(q.method==='POST'&&u.pathname==='/v1/door/model-test'){const shared=shelf.current('shared');const result=await router.cognize('door-test',{shared_cognition:shared.value,questions:['unknown_guanghu_information_source','identity_before_persona_load','reality_authority_from_cognition']});return send(r,200,{outcome:'PASS',provider:result.provider,answers:result.value,shared_sha256:shared.artifact.sha256,credentials_exposed:false});}
|
||||
if(q.method==='GET'&&u.pathname==='/v1/world/status')return send(r,200,world.status());
|
||||
if(q.method==='GET'&&u.pathname==='/v1/world/resolve')return send(r,200,world.resolve(String(u.searchParams.get('id')||'')));
|
||||
if(q.method==='POST'&&u.pathname==='/v1/lamp/ignite')return send(r,200,lamp.ignite(await body(q,20000)));
|
||||
if(q.method==='POST'&&u.pathname==='/v1/lamp/ask')return send(r,200,lamp.ask(await body(q,20000)));
|
||||
return send(r,404,{error:'not_found'});}catch(e){return send(r,400,{error:String(e.message||e).slice(0,300)});}}).listen(PORT,HOST,()=>process.stdout.write(`tcs-single-mother listening ${HOST}:${PORT}\n`));
|
||||
|
|
|
|||
|
|
@ -0,0 +1,19 @@
|
|||
{
|
||||
"schema":"guanghu.tcs-root-number-impact/v1",
|
||||
"impact_id":"TCS-ROOT-NUMBER-IMPACT-LIVING-LAMP-LIGHTHOUSE-ECHO-20260908-001",
|
||||
"state":"CURRENT_DIRECT_LANGUAGE_SCREENSHOT_AND_TWO_SERVER_READBACK_BOUND",
|
||||
"bootstrap":false,
|
||||
"source_tcs":"runtime/fifth-domain-language-system/language/protocols/TCS-LIVING-LAMP-LIGHTHOUSE-ECHO-KERNEL-20260908.tcs",
|
||||
"source_gir":"runtime/fifth-domain-language-system/language/protocols/TCS-LIVING-LAMP-LIGHTHOUSE-ECHO-KERNEL-20260908.gir.json",
|
||||
"commit_binding":"SAME_COMMIT_OR_DESCENDANT_CONTAINING_IDENTICAL_SOURCE_AND_GIR",
|
||||
"affected_paths":["routing/tcs-mother-root-dynamic-navigation-map.json","routing/tcs-mother-brain-runtime-map.json","routing/guanghu-era-language-world.json","routing/lighthouse-path-registry.json","routing/linguistic-echo-lamp-map.json"],
|
||||
"new_canonical_objects":[
|
||||
{"canonical_id":"ECHO-KERNEL-0001","object_kind":"LIVING_LANGUAGE_ECHO_STATE_KERNEL"},
|
||||
{"canonical_id":"TCS-0002∞-LakeEcho-0001","object_kind":"PUBLIC_LINGUISTIC_ECHO_SYSTEM"},
|
||||
{"canonical_id":"SYS-GLW-ECHO-0001","object_kind":"FIFTH_DOMAIN_PRIVATE_LINGUISTIC_ECHO_SYSTEM"},
|
||||
{"canonical_id":"LAKE-LAMP-LIVING-NAV-0001","object_kind":"FIFTH_DOMAIN_LIVING_NAVIGATION_LAMP"},
|
||||
{"canonical_id":"SYS-GLW-LTH-0001","object_kind":"ENTERPRISE_LIVING_NAVIGATION_LIGHTHOUSE"}
|
||||
],
|
||||
"human_source":"ICE-GL∞_CURRENT_DIRECT_LIVING_LAMP_AND_ECHO_TASK",
|
||||
"ordinary_file_change_may_update_current":false
|
||||
}
|
||||
Loading…
Reference in a new issue