From 771a73029e711c585696d93d68c47553d3fbf765 Mon Sep 17 00:00:00 2001 From: Zaine Arch Date: Sun, 10 May 2026 15:43:22 +0100 Subject: [PATCH] updating hidden service --- authoring_server.py | 947 ++++++++++++++++++++++++++++---------------- 1 file changed, 611 insertions(+), 336 deletions(-) diff --git a/authoring_server.py b/authoring_server.py index 9ab65de..a578afa 100755 --- a/authoring_server.py +++ b/authoring_server.py @@ -145,6 +145,38 @@ HIDDEN_CONTENT_TYPES = [ HIDDEN_CHARACTERS = ["Lima", "Aphy", "Sensei Chi", "Young Z", "Future Z", "Z"] HIDDEN_TONES = ["warm", "funny", "nostalgic", "wise", "strange", "soft", "hopeful", "protective", "melancholy"] HIDDEN_RARITIES = ["common", "uncommon", "rare", "very rare", "seasonal", "timed"] +HIDDEN_LAYER_DEPTHS = [ + { + "id": "0", + "name": "Surface Reality", + "meaning": "Normal visible website content, visible warmth, and ordinary interactions.", + }, + { + "id": "1", + "name": "Hidden Personality", + "meaning": "Small hidden jokes, hover text, tiny discoveries, and recurring symbols.", + }, + { + "id": "2", + "name": "Memory Layer", + "meaning": "Young Z memories, Lima notes, nostalgia, and emotional fragments.", + }, + { + "id": "3", + "name": "Reflection Layer", + "meaning": "Sensei Chi philosophy, Aphy conversations, and introspection.", + }, + { + "id": "4", + "name": "Time Layer", + "meaning": "Future Z logs, time anomalies, long-term revisits, and future/past echoes.", + }, + { + "id": "5", + "name": "Core Layer", + "meaning": "Rare deeply emotional truths found by patient exploration.", + }, +] def slugify(value: str) -> str: @@ -788,6 +820,19 @@ def make_hidden_entry(content_type: str, content: str, index: int, **extra: Any) "cssClassHooks": extra.pop("cssClassHooks", ""), "chainReferences": extra.pop("chainReferences", []), "continuationLinks": extra.pop("continuationLinks", []), + "emotionalRole": extra.pop("emotionalRole", ""), + "discoveryDifficulty": extra.pop("discoveryDifficulty", "gentle"), + "mysteryLevel": extra.pop("mysteryLevel", "quiet"), + "resonanceScore": extra.pop("resonanceScore", 3), + "symbols": extra.pop("symbols", []), + "narrativeArcs": extra.pop("narrativeArcs", []), + "parentLinks": extra.pop("parentLinks", []), + "childLinks": extra.pop("childLinks", []), + "echoes": extra.pop("echoes", []), + "mirroredEntries": extra.pop("mirroredEntries", []), + "thematicLinks": extra.pop("thematicLinks", []), + "symbolicLinks": extra.pop("symbolicLinks", []), + "triggerLinks": extra.pop("triggerLinks", []), } entry.update(extra) return entry @@ -881,6 +926,25 @@ def normalize_hidden_entry(raw: dict[str, Any], existing: dict[str, Any] | None entry["cssClassHooks"] = str(entry.get("cssClassHooks") or "") entry["chainReferences"] = [str(item).strip() for item in entry.get("chainReferences", []) if str(item).strip()] entry["continuationLinks"] = [str(item).strip() for item in entry.get("continuationLinks", []) if str(item).strip()] + entry["emotionalRole"] = str(entry.get("emotionalRole") or "") + entry["discoveryDifficulty"] = str(entry.get("discoveryDifficulty") or "gentle") + entry["mysteryLevel"] = str(entry.get("mysteryLevel") or "quiet") + try: + entry["resonanceScore"] = max(1, min(10, int(entry.get("resonanceScore") or 3))) + except (TypeError, ValueError): + entry["resonanceScore"] = 3 + for key in [ + "symbols", + "narrativeArcs", + "parentLinks", + "childLinks", + "echoes", + "mirroredEntries", + "thematicLinks", + "symbolicLinks", + "triggerLinks", + ]: + entry[key] = [str(item).strip() for item in entry.get(key, []) if str(item).strip()] return entry @@ -908,6 +972,7 @@ def load_hidden_store() -> dict[str, Any]: "characters": HIDDEN_CHARACTERS, "tones": HIDDEN_TONES, "rarities": HIDDEN_RARITIES, + "layers": HIDDEN_LAYER_DEPTHS, "entries": normalized, "recommendations": hidden_architecture_recommendations(), } @@ -915,11 +980,11 @@ def load_hidden_store() -> dict[str, Any]: def hidden_architecture_recommendations() -> dict[str, Any]: return { - "storage": "Use assets/content/hidden-details.json as the friendly source of truth and regenerate the editable constants in assets/scripts/hidden-details.js.", + "storage": "Use assets/content/hidden-details.json as the friendly source of truth for narrative nodes, then regenerate the editable constants in assets/scripts/hidden-details.js.", "backups": "Every save writes timestamped backups for both JSON and JS under backups/hidden-details/.", "versioning": "Commit the JSON and generated JS together so the live site and authoring history stay aligned.", - "collaboration": "For simultaneous editing, add per-entry modified timestamps and resolve conflicts by entry id before writing.", - "scalability": "The schema is entry-based, so future rooms, arcs, audio cues, and relationship graphs can be added without rewriting the editor.", + "collaboration": "For simultaneous editing, resolve conflicts by narrative node id and relationship fields, not by whole-file ownership.", + "scalability": "The graph model can grow into arc folders, richer discovery flows, symbolic indexes, and per-character constellation views without changing the live hidden-details runtime.", } @@ -2186,249 +2251,341 @@ HIDDEN_APP_HTML = r""" - Hidden Narrative Desk + Hidden Memory Observatory -
-