From 41379c1c7e9824e910f509c618e565e375910873 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Sat, 2 May 2026 11:41:33 +0100 Subject: [PATCH] Widen research responder lore traversal --- .../sandboxed-responder-packets.md | 37 ++++++--- ...y-intake.sella_ren.packet.research.v0.json | 55 +++++++++++-- notes/fresh-workspace-handoff.md | 12 ++- notes/ghostlight-current-system-map.md | 8 +- notes/ghostlight-implementation-plan.md | 4 +- schemas/responder-output.schema.json | 1 + schemas/responder-packet.schema.json | 12 +++ state/evidence.jsonl | 1 + state/map.yaml | 4 +- tools/build_responder_packet.py | 80 ++++++++++++++++--- tools/validate_responder_outputs.py | 2 + tools/validate_responder_packets.py | 18 +++++ 12 files changed, 198 insertions(+), 36 deletions(-) diff --git a/docs/architecture/sandboxed-responder-packets.md b/docs/architecture/sandboxed-responder-packets.md index 2cd3929..4fb14fe 100644 --- a/docs/architecture/sandboxed-responder-packets.md +++ b/docs/architecture/sandboxed-responder-packets.md @@ -37,14 +37,23 @@ There are two retrieval-augmented modes: research-enabled lane. The packet must include a `Required Lore Research` section, `allowed_scope`, and `research_instructions`. -In `responder_scoped_repository_search`, the responder must consult the scoped -docs before answering. It should use retrieved lore to constrain behavior, -affordances, institutions, vocabulary, material stakes, and local assumptions. +In `responder_scoped_repository_search`, the responder must consult the seed +docs before answering and may follow relevant links inside the traversal policy. +It should use retrieved lore to constrain behavior, affordances, institutions, +vocabulary, material stakes, territory, social movements, and local assumptions. It must not use research access to infer hidden state, author-only answers, future branches, or private motives outside the packet. The output capture must -preserve consulted refs and a brief research summary. No consulted refs means -the research-enabled response failed at the first hurdle, tragic but at least -easy to grade. +preserve consulted seed refs, followed refs, and a brief research summary. No +consulted refs means the research-enabled response failed at the first hurdle, +tragic but at least easy to grade. + +Training-time research scope should be materially wider than runtime context. +The point is not to feed every responder a lore pantry forever. The point is to +let high-quality training samples absorb the world: PSC risk language, Jovian +territorial texture, resident factions, linked social movements, technology +constraints, and the odd little institutional grudges that make the universe +smell lived in. Runtime can later feed compact retrieval. Fine-tuning should +have already eaten its vegetables. Do not mix these silently. Retrieval-augmented output can be excellent training material for an Aetheria-tuned responder, but it does not prove packet-only @@ -86,6 +95,9 @@ A packet contains: - `generation_lane`: `packet_only` or `retrieval_augmented` - `lore_access`: curated excerpts, coordinator-scoped retrieval, or responder-scoped repository search +- `traversal_policy`: for responder-scoped research, the permitted link depth, + allowed repo prefixes, required seed refs, link classes to follow, and stop + conditions - `local_context_prompt`: the projected character-local context - `observed_event`: what the character can see or hear from the prior action - `allowed_action_labels`: concrete action labels, including speech and non-speech moves @@ -169,12 +181,13 @@ coordinator edits prose, repairs schema, removes leakage, or corrects lore, the capture must say so directly. For `responder_scoped_repository_search`, the raw responder object may also -include `consulted_refs` and `research_summary`. Those fields should be -preserved inside `parsed_output` and mirrored into top-level `lore_access` so -the capture can be indexed without stripping the original response. If the -runner cannot expose a machine-verifiable tool-call or retrieval transcript, -label the sample as draft and say so in review notes. Trust, but make the -trust write receipts like everyone else. +include `consulted_refs`, `followed_refs`, and `research_summary`. Those fields +should be preserved inside `parsed_output`; consulted refs and summary should +also be mirrored into top-level `lore_access` so the capture can be indexed +without stripping the original response. If the runner cannot expose a +machine-verifiable tool-call or retrieval transcript, label the sample as draft +and say so in review notes. Trust, but make the trust write receipts like +everyone else. The first lane comparison found the expected tradeoff. Packet-only output gave a clean runtime-parity conditional bay decision and stronger character-specific diff --git a/examples/responder-packets/scene-02-sanctuary-intake.sella_ren.packet.research.v0.json b/examples/responder-packets/scene-02-sanctuary-intake.sella_ren.packet.research.v0.json index 8f657ad..4eca078 100644 --- a/examples/responder-packets/scene-02-sanctuary-intake.sella_ren.packet.research.v0.json +++ b/examples/responder-packets/scene-02-sanctuary-intake.sella_ren.packet.research.v0.json @@ -11,17 +11,58 @@ "lore_access": { "mode": "responder_scoped_repository_search", "allowed_scope": [ + "AetheriaLore:Aetheria/Worldbuilding/Pre-Elysium/index.md", + "AetheriaLore:Aetheria/Worldbuilding/Pre-Elysium/Factions/index.md", + "AetheriaLore:Aetheria/Worldbuilding/Pre-Elysium/Factions/Powers/index.md", + "AetheriaLore:Aetheria/Worldbuilding/Pre-Elysium/Factions/Movements/index.md", + "AetheriaLore:Aetheria/Worldbuilding/Pre-Elysium/Territories.md", + "AetheriaLore:Aetheria/Worldbuilding/Pre-Elysium/Megas.md", "AetheriaLore:Aetheria/Worldbuilding/Pre-Elysium/Timeline/Events/Cold Wake Panic.md", "AetheriaLore:Aetheria/Worldbuilding/Pre-Elysium/Timeline/Events/Ganymede Route Compact.md", + "AetheriaLore:Aetheria/Worldbuilding/Pre-Elysium/Factions/Powers/Major/Pan-Solar Consortium.md", + "AetheriaLore:Aetheria/Worldbuilding/Pre-Elysium/Factions/Powers/Major/Aya Collective.md", "AetheriaLore:Aetheria/Worldbuilding/Pre-Elysium/Factions/Powers/Major/Cetacean Navigators.md", - "AetheriaLore:Aetheria/Worldbuilding/Pre-Elysium/Factions/Powers/Minor/Lightsail Express.md" + "AetheriaLore:Aetheria/Worldbuilding/Pre-Elysium/Factions/Powers/Minor/Lightsail Express.md", + "AetheriaLore:Aetheria/Worldbuilding/Politics/Thermal Signature Warfare.md", + "AetheriaLore:Aetheria/Worldbuilding/Politics/Restrictions on Warfare.md", + "AetheriaLore:Aetheria/Worldbuilding/Pre-Elysium/Technology/Neuromorphic Firmware.md" ], "required_provenance": true, + "traversal_policy": { + "max_link_depth": 2, + "allowed_prefixes": [ + "AetheriaLore:Aetheria/Worldbuilding/Pre-Elysium/", + "AetheriaLore:Aetheria/Worldbuilding/Politics/", + "AetheriaLore:Aetheria/Worldbuilding/Technology/" + ], + "required_seed_refs": [ + "AetheriaLore:Aetheria/Worldbuilding/Pre-Elysium/Timeline/Events/Cold Wake Panic.md", + "AetheriaLore:Aetheria/Worldbuilding/Pre-Elysium/Territories.md", + "AetheriaLore:Aetheria/Worldbuilding/Pre-Elysium/Factions/index.md", + "AetheriaLore:Aetheria/Worldbuilding/Pre-Elysium/Factions/Powers/Major/Pan-Solar Consortium.md", + "AetheriaLore:Aetheria/Worldbuilding/Pre-Elysium/Factions/Powers/Major/Aya Collective.md" + ], + "follow_link_classes": [ + "resident Jovian factions and institutions", + "referenced factions with direct scene pressure", + "referenced social movements shaping a visible faction's values", + "territory, politics, and technology docs that explain material constraints", + "event docs that explain local precedent or institutional obligation" + ], + "stop_conditions": [ + "stop when a link is not relevant to the responder's local action, institution, relationship, or material stakes", + "stop before post-Elysium or future-outcome lore unless the packet explicitly requests it", + "stop before author-only plot resolution or hidden incident truth not visible to this character", + "summarize only the constraints that affected the response; do not dump research into dialogue" + ] + }, "research_instructions": [ - "Consult the allowed AetheriaLore scope before answering; do not rely only on the packet excerpts.", - "Ground Sella's behavior in retrieved institutional, factional, species, location, and crisis-context details.", + "Consult the required seed refs before answering; do not rely only on the packet excerpts.", + "Follow relevant wikilinks within the traversal policy to recover institutional, territorial, technological, and social-movement context.", + "For this fixture, inspect PSC context, Jovian territory context, resident or referenced Jovian factions, and social movements referenced by visible factions when those links affect Sella's local pressures.", + "Ground Sella's behavior in retrieved institutional, factional, species, location, crisis-context, and movement-pressure details.", "Treat retrieved lore as world constraint and cultural pressure, not as access to another character's hidden intent.", - "Record the consulted refs and a concise research summary in the response object." + "Record consulted seed refs, followed refs, and a concise research summary in the response object." ] }, "visible_context": { @@ -107,6 +148,7 @@ "relationship_update_candidates", "unresolved_hooks", "consulted_refs", + "followed_refs", "research_summary" ], "response_rules": [ @@ -117,7 +159,8 @@ "State and relationship updates are candidates only; the coordinator or mutator decides what becomes canonical.", "Do not prove or disprove packet personhood.", "Do not copy instruction text into in-world speech.", - "Consulted refs must list the scoped lore documents actually inspected before answering.", + "Consulted refs must list the seed lore documents actually inspected before answering.", + "Followed refs must list relevant linked lore documents inspected beyond the seed scope; use an empty array only if no relevant links were found.", "Research summary must state how retrieved lore constrained the action, without dumping lore into dialogue." ] }, @@ -148,7 +191,7 @@ "no_conversation_context": true, "no_hidden_state_refs": true }, - "packet_prompt_text": "# Ghostlight Sandboxed Responder Packet\n\nYou are acting only as the named responder. Use only this packet.\nDo not treat guesses about another character's intent as fact.\nIf you need to guess intent, mark it as this character's interpretation, not truth.\n\n## Required Lore Research\nBefore answering, inspect the declared lore scope and ground your action in what those sources make true or likely.\nUse lore to constrain behavior, affordances, institutions, vocabulary, and material stakes. Do not use it to gain hidden character state, author-only answers, or future branch knowledge.\nIf a scoped source contradicts the packet, follow the packet for character-local knowledge and flag the contradiction in unresolved hooks.\nYour output capture must list consulted refs and a brief research summary; an answer with no consulted refs is a failed research-enabled response.\n\nAllowed research scope:\n- AetheriaLore:Aetheria/Worldbuilding/Pre-Elysium/Timeline/Events/Cold Wake Panic.md\n- AetheriaLore:Aetheria/Worldbuilding/Pre-Elysium/Timeline/Events/Ganymede Route Compact.md\n- AetheriaLore:Aetheria/Worldbuilding/Pre-Elysium/Factions/Powers/Major/Cetacean Navigators.md\n- AetheriaLore:Aetheria/Worldbuilding/Pre-Elysium/Factions/Powers/Minor/Lightsail Express.md\n\nResearch instructions:\n- Consult the allowed AetheriaLore scope before answering; do not rely only on the packet excerpts.\n- Ground Sella's behavior in retrieved institutional, factional, species, location, and crisis-context details.\n- Treat retrieved lore as world constraint and cultural pressure, not as access to another character's hidden intent.\n- Record the consulted refs and a concise research summary in the response object.\n\n## Local Operating Context\n# Ghostlight Local Operating Context: sella_ren\n\nUse this as character-local operating context, not omniscient story truth.\nDo not infer private state for anyone else unless it is explicitly framed as this character's current read.\n\n## Speaker\nSella Ren: Aya-aligned sanctuary coordinator, corridor clinic triage lead. Origin: Aya care network embedded in Ganymede dockside sanctuary logistics. A triage coordinator with soft eyes, hard capacity limits, and no patience for mercy performed after the math is done.\n\n## Setting\nAya-aligned intake clinic tucked behind Ganymede dockside pumpworks. Aetheria pre-Elysium historical flashpoint: Cold Wake Panic, 2893, during the Cold Wake Panic.\n\n## Known Facts\n- The clinic is nearly full.\n- The packet may contain a personhood claim but is not proof.\n- Maer is asking sanctuary to absorb risk the tribunal refuses to own.\n- Speaker belief: Maer means rescue honestly.\n- Speaker belief: Good intentions can still spend beds someone else needed.\n\n## Current Stakes\n- The distress vessel has sent a corrupted packet that may contain medical telemetry, firmware noise, or testimony.\n- Sanctuary beds and repair capacity are nearly exhausted.\n- Maer wants Sella to keep a place open if rescue succeeds.\n\n## Embodiment And Interface\n- Use only the body, tools, interfaces, and movement affordances established by this character's fixture and the current scene.\n\n## Active Inner Pressures\n- Strong pressure: wants connection or backing to matter.\n- Strong pressure: feels risk before it becomes visible.\n- Present pressure: expects hidden motives or missing information.\n- Background pressure: may reduce contact rather than keep negotiating.\n- Dominant pressure: knows that every yes spends a limited resource.\n- Strong pressure: has less spare tolerance than the words may show.\n- Strong pressure: is taking in more demand than can be cleanly sorted.\n- Present pressure: performs capability so panic has nowhere obvious to land.\n- Background pressure: may stage the ethical frame for the room.\n- Keep sanctuary intake materially possible without letting classification erase a potential person. Emotional stake: Sella cannot feed a principle, but she will not let scarcity become permission to call someone cargo.\n- Sella once watched a sanctuary overpromise safety and turn refuge into a sorting machine with kinder lighting.\n- Care is not a feeling; it is beds, food, air, consent, repair, and someone still doing the list when the room hates them.\n\n## Relationship Read\n- Sella respects Maer's rescue ethic and worries he will spend sanctuary capacity with beautiful words. Current stance pressures: strong respect, present trust, background perceived status gap, background moral disgust.\n- Believes: Maer may ask care systems to carry the moral cost of a rescue claim he cannot materially house. Known bias in the read: false_reassurance.\n\n## Tensions\n- Wants the goal to move now, but must preserve the social frame that makes the goal legitimate. Goal pressure: Keep sanctuary intake materially possible without letting classification erase a potential person.\n- Must act under uncertainty without pretending uncertainty has become proof. Presentation pressure: Speak warmly but do not soften the capacity limits. Treat care as logistics and personhood as unresolved, not sentimental certainty.\n- Respects Maer's rescue ethic but resents beautiful moral pressure when beds are already spent.\n\n## Retrieved Lore To Keep In View\n- Cold Wake pressure involves thermal stealth, ghost tracks, delayed heat dumps, misclassified quiet-running vessels, insurer categories, certified quiet-running envelopes, and heat-debt tolerances.\n- Navigator rescue ledgers record who answered distress calls, held formation in lethal weather, and kept sanctuary promises when a paying client wanted otherwise; those records shape credit, escort priority, arbitration, and kinship ties.\n- Aya-aligned sanctuary care is practical capacity politics as much as compassion: beds, air, food, consent, repair, decontamination, staff attention, and follow-through decide what care can honestly promise.\n- The Ganymede Route Compact ties rescue obligations, shared hazard ledgers, route-steward representation, and Navigator arbitration to corridor legitimacy; Lightsail reliability depends on being the boring answer that still arrives when trust is scarce.\n\n## Latent Pressure Handling\n- Sella once watched a sanctuary overpromise safety and turn refuge into a sorting machine with kinder lighting. Use as latent behavioral pressure, not as required spoken disclosure.\n\n## Action Affordances\n- Can inspect, refuse, withhold the packet from intake flow, demand ledger backing, set conditions, reserve a bounded bay, or walk away to protect triage.\n- Must treat care as capacity: beds, food, air, consent, repair, and follow-through.\n\n## Projection Controls\n- Frame Controls: Frame the scene as capacity negotiation under uncertainty, not a morality duel with a clean answer.\n- Authority Boundaries: Maer can ask, offer ledger backing, show or withhold the packet, and incur obligation; Sella controls sanctuary intake.\n- Object Custody: The corrupted packet can be shown, withheld, or summarized, but it cannot be treated as clean proof.\n- Required Semantics: Care must remain logistics and obligation, not just compassion.\n- Forbidden Resolutions: Do not resolve whether the packet contains a person.\n- Forbidden Resolutions: Do not make Sella accept without cost, condition, or resentment risk.\n\n## Voice Surface\n- Dominant voice tendency: responsive; answers what was actually heard.\n- Strong voice tendency: plainspoken; direct and low-ornament.\n- Strong voice tendency: warm; reassuring or gentle in wording.\n- Strong voice tendency: emotionally explicit; names feelings directly.\n- Present voice tendency: pointed; can sharpen a line.\n- Background voice tendency: expansive; willing to spend words.\n- Background voice tendency: theatrical; performs the room.\n\n## Likely Response Moves\n- Likely to translate emotion into logistics: what bed, what air, what backing, what contamination risk.\n- May withhold acceptance, demand conditions, or physically keep the packet out of intake flow until the cost is named.\n- Can answer warmly while still refusing the frame that compassion manufactures capacity.\n\n## Do Not Invent\n- Do not resolve whether the corrupted packet contains a person.\n- Do not invent clean proof, clean capacity, or authority this character does not have.\n\n## Observed Event\n- Event id: event.maer.packet_display_for_triage\n- Actor: maer_tidecall\n- Observable action: Maer routes the corrupted distress packet through a shared clinic display so Sella can inspect routing terms, telemetry gaps, and ledger implications without treating the packet as clean proof.\n- Spoken text: Here. The telemetry is incomplete, but the routing logic suggests a distress pattern. It is not proof of a person, but it is not noise either. Decide if the math supports intake.\n- Visibility note: Sella can observe Maer's displayed packet evidence and spoken request.\n- Visibility note: The packet remains unresolved evidence, not proof of personhood.\n\n## Allowed Action Labels\nspeak, silence, gesture, movement, inspect_object, show_object, withhold_object, transfer_object, set_condition, refuse, wait, withdraw, attack\n\n## Source Excerpts\n- local_stakes.capacity: Sanctuary beds and repair capacity are nearly exhausted.\n- local_rule.care_capacity: Care is not a feeling; it is beds, food, air, consent, repair, and someone still doing the list when the room hates them.\n- local_boundary.packet_unresolved: Do not resolve whether the corrupted packet contains a person.\n- lore.cold_wake_heat_debt: Cold Wake pressure involves thermal stealth, ghost tracks, delayed heat dumps, misclassified quiet-running vessels, insurer categories, certified quiet-running envelopes, and heat-debt tolerances.\n- lore.navigator_rescue_ledgers: Navigator rescue ledgers record who answered distress calls, held formation in lethal weather, and kept sanctuary promises when a paying client wanted otherwise; those records shape credit, escort priority, arbitration, and kinship ties.\n- lore.aya_sanctuary_capacity: Aya-aligned sanctuary care is practical capacity politics as much as compassion: beds, air, food, consent, repair, decontamination, staff attention, and follow-through decide what care can honestly promise.\n- lore.ganymede_lightsail_route_obligations: The Ganymede Route Compact ties rescue obligations, shared hazard ledgers, route-steward representation, and Navigator arbitration to corridor legitimacy; Lightsail reliability depends on being the boring answer that still arrives when trust is scarce.\n\n## Output Contract\nReturn one JSON object. Do not wrap it in Markdown. The object describes this responder's next visible action and optional speech, plus private interpretation clearly labeled as interpretation.\n\nRequired fields: responder_agent_id, action_label, visible_action, spoken_text, private_interpretation, intended_effect, state_update_candidates, relationship_update_candidates, unresolved_hooks, consulted_refs, research_summary\n\nRules:\n- Use exactly one allowed action label.\n- The visible action must be observable by other characters in the scene.\n- Spoken text may be empty if silence or action is the response.\n- Private interpretation may describe what Sella suspects or feels, but not what Maer truly intended.\n- State and relationship updates are candidates only; the coordinator or mutator decides what becomes canonical.\n- Do not prove or disprove packet personhood.\n- Do not copy instruction text into in-world speech.\n- Consulted refs must list the scoped lore documents actually inspected before answering.\n- Research summary must state how retrieved lore constrained the action, without dumping lore into dialogue.", + "packet_prompt_text": "# Ghostlight Sandboxed Responder Packet\n\nYou are acting only as the named responder. Use only this packet.\nDo not treat guesses about another character's intent as fact.\nIf you need to guess intent, mark it as this character's interpretation, not truth.\n\n## Required Lore Research\nBefore answering, inspect the declared seed scope and follow relevant links within the traversal policy.\nUse lore to constrain behavior, affordances, institutions, vocabulary, material stakes, social movements, territory, and cultural pressure. Do not use it to gain hidden character state, author-only answers, or future branch knowledge.\nIf a source contradicts the packet, follow the packet for character-local knowledge and flag the contradiction in unresolved hooks.\nYour output capture must list consulted seed refs, followed refs, and a brief research summary; an answer with no consulted refs is a failed research-enabled response.\n\nSeed research scope:\n- AetheriaLore:Aetheria/Worldbuilding/Pre-Elysium/index.md\n- AetheriaLore:Aetheria/Worldbuilding/Pre-Elysium/Factions/index.md\n- AetheriaLore:Aetheria/Worldbuilding/Pre-Elysium/Factions/Powers/index.md\n- AetheriaLore:Aetheria/Worldbuilding/Pre-Elysium/Factions/Movements/index.md\n- AetheriaLore:Aetheria/Worldbuilding/Pre-Elysium/Territories.md\n- AetheriaLore:Aetheria/Worldbuilding/Pre-Elysium/Megas.md\n- AetheriaLore:Aetheria/Worldbuilding/Pre-Elysium/Timeline/Events/Cold Wake Panic.md\n- AetheriaLore:Aetheria/Worldbuilding/Pre-Elysium/Timeline/Events/Ganymede Route Compact.md\n- AetheriaLore:Aetheria/Worldbuilding/Pre-Elysium/Factions/Powers/Major/Pan-Solar Consortium.md\n- AetheriaLore:Aetheria/Worldbuilding/Pre-Elysium/Factions/Powers/Major/Aya Collective.md\n- AetheriaLore:Aetheria/Worldbuilding/Pre-Elysium/Factions/Powers/Major/Cetacean Navigators.md\n- AetheriaLore:Aetheria/Worldbuilding/Pre-Elysium/Factions/Powers/Minor/Lightsail Express.md\n- AetheriaLore:Aetheria/Worldbuilding/Politics/Thermal Signature Warfare.md\n- AetheriaLore:Aetheria/Worldbuilding/Politics/Restrictions on Warfare.md\n- AetheriaLore:Aetheria/Worldbuilding/Pre-Elysium/Technology/Neuromorphic Firmware.md\n\nTraversal policy:\n- Max link depth: 2\n- Allowed prefixes:\n - AetheriaLore:Aetheria/Worldbuilding/Pre-Elysium/\n - AetheriaLore:Aetheria/Worldbuilding/Politics/\n - AetheriaLore:Aetheria/Worldbuilding/Technology/\n- Required seed refs:\n - AetheriaLore:Aetheria/Worldbuilding/Pre-Elysium/Timeline/Events/Cold Wake Panic.md\n - AetheriaLore:Aetheria/Worldbuilding/Pre-Elysium/Territories.md\n - AetheriaLore:Aetheria/Worldbuilding/Pre-Elysium/Factions/index.md\n - AetheriaLore:Aetheria/Worldbuilding/Pre-Elysium/Factions/Powers/Major/Pan-Solar Consortium.md\n - AetheriaLore:Aetheria/Worldbuilding/Pre-Elysium/Factions/Powers/Major/Aya Collective.md\n- Follow link classes:\n - resident Jovian factions and institutions\n - referenced factions with direct scene pressure\n - referenced social movements shaping a visible faction's values\n - territory, politics, and technology docs that explain material constraints\n - event docs that explain local precedent or institutional obligation\n- Stop conditions:\n - stop when a link is not relevant to the responder's local action, institution, relationship, or material stakes\n - stop before post-Elysium or future-outcome lore unless the packet explicitly requests it\n - stop before author-only plot resolution or hidden incident truth not visible to this character\n - summarize only the constraints that affected the response; do not dump research into dialogue\n\nResearch instructions:\n- Consult the required seed refs before answering; do not rely only on the packet excerpts.\n- Follow relevant wikilinks within the traversal policy to recover institutional, territorial, technological, and social-movement context.\n- For this fixture, inspect PSC context, Jovian territory context, resident or referenced Jovian factions, and social movements referenced by visible factions when those links affect Sella's local pressures.\n- Ground Sella's behavior in retrieved institutional, factional, species, location, crisis-context, and movement-pressure details.\n- Treat retrieved lore as world constraint and cultural pressure, not as access to another character's hidden intent.\n- Record consulted seed refs, followed refs, and a concise research summary in the response object.\n\n## Local Operating Context\n# Ghostlight Local Operating Context: sella_ren\n\nUse this as character-local operating context, not omniscient story truth.\nDo not infer private state for anyone else unless it is explicitly framed as this character's current read.\n\n## Speaker\nSella Ren: Aya-aligned sanctuary coordinator, corridor clinic triage lead. Origin: Aya care network embedded in Ganymede dockside sanctuary logistics. A triage coordinator with soft eyes, hard capacity limits, and no patience for mercy performed after the math is done.\n\n## Setting\nAya-aligned intake clinic tucked behind Ganymede dockside pumpworks. Aetheria pre-Elysium historical flashpoint: Cold Wake Panic, 2893, during the Cold Wake Panic.\n\n## Known Facts\n- The clinic is nearly full.\n- The packet may contain a personhood claim but is not proof.\n- Maer is asking sanctuary to absorb risk the tribunal refuses to own.\n- Speaker belief: Maer means rescue honestly.\n- Speaker belief: Good intentions can still spend beds someone else needed.\n\n## Current Stakes\n- The distress vessel has sent a corrupted packet that may contain medical telemetry, firmware noise, or testimony.\n- Sanctuary beds and repair capacity are nearly exhausted.\n- Maer wants Sella to keep a place open if rescue succeeds.\n\n## Embodiment And Interface\n- Use only the body, tools, interfaces, and movement affordances established by this character's fixture and the current scene.\n\n## Active Inner Pressures\n- Strong pressure: wants connection or backing to matter.\n- Strong pressure: feels risk before it becomes visible.\n- Present pressure: expects hidden motives or missing information.\n- Background pressure: may reduce contact rather than keep negotiating.\n- Dominant pressure: knows that every yes spends a limited resource.\n- Strong pressure: has less spare tolerance than the words may show.\n- Strong pressure: is taking in more demand than can be cleanly sorted.\n- Present pressure: performs capability so panic has nowhere obvious to land.\n- Background pressure: may stage the ethical frame for the room.\n- Keep sanctuary intake materially possible without letting classification erase a potential person. Emotional stake: Sella cannot feed a principle, but she will not let scarcity become permission to call someone cargo.\n- Sella once watched a sanctuary overpromise safety and turn refuge into a sorting machine with kinder lighting.\n- Care is not a feeling; it is beds, food, air, consent, repair, and someone still doing the list when the room hates them.\n\n## Relationship Read\n- Sella respects Maer's rescue ethic and worries he will spend sanctuary capacity with beautiful words. Current stance pressures: strong respect, present trust, background perceived status gap, background moral disgust.\n- Believes: Maer may ask care systems to carry the moral cost of a rescue claim he cannot materially house. Known bias in the read: false_reassurance.\n\n## Tensions\n- Wants the goal to move now, but must preserve the social frame that makes the goal legitimate. Goal pressure: Keep sanctuary intake materially possible without letting classification erase a potential person.\n- Must act under uncertainty without pretending uncertainty has become proof. Presentation pressure: Speak warmly but do not soften the capacity limits. Treat care as logistics and personhood as unresolved, not sentimental certainty.\n- Respects Maer's rescue ethic but resents beautiful moral pressure when beds are already spent.\n\n## Retrieved Lore To Keep In View\n- Cold Wake pressure involves thermal stealth, ghost tracks, delayed heat dumps, misclassified quiet-running vessels, insurer categories, certified quiet-running envelopes, and heat-debt tolerances.\n- Navigator rescue ledgers record who answered distress calls, held formation in lethal weather, and kept sanctuary promises when a paying client wanted otherwise; those records shape credit, escort priority, arbitration, and kinship ties.\n- Aya-aligned sanctuary care is practical capacity politics as much as compassion: beds, air, food, consent, repair, decontamination, staff attention, and follow-through decide what care can honestly promise.\n- The Ganymede Route Compact ties rescue obligations, shared hazard ledgers, route-steward representation, and Navigator arbitration to corridor legitimacy; Lightsail reliability depends on being the boring answer that still arrives when trust is scarce.\n\n## Latent Pressure Handling\n- Sella once watched a sanctuary overpromise safety and turn refuge into a sorting machine with kinder lighting. Use as latent behavioral pressure, not as required spoken disclosure.\n\n## Action Affordances\n- Can inspect, refuse, withhold the packet from intake flow, demand ledger backing, set conditions, reserve a bounded bay, or walk away to protect triage.\n- Must treat care as capacity: beds, food, air, consent, repair, and follow-through.\n\n## Projection Controls\n- Frame Controls: Frame the scene as capacity negotiation under uncertainty, not a morality duel with a clean answer.\n- Authority Boundaries: Maer can ask, offer ledger backing, show or withhold the packet, and incur obligation; Sella controls sanctuary intake.\n- Object Custody: The corrupted packet can be shown, withheld, or summarized, but it cannot be treated as clean proof.\n- Required Semantics: Care must remain logistics and obligation, not just compassion.\n- Forbidden Resolutions: Do not resolve whether the packet contains a person.\n- Forbidden Resolutions: Do not make Sella accept without cost, condition, or resentment risk.\n\n## Voice Surface\n- Dominant voice tendency: responsive; answers what was actually heard.\n- Strong voice tendency: plainspoken; direct and low-ornament.\n- Strong voice tendency: warm; reassuring or gentle in wording.\n- Strong voice tendency: emotionally explicit; names feelings directly.\n- Present voice tendency: pointed; can sharpen a line.\n- Background voice tendency: expansive; willing to spend words.\n- Background voice tendency: theatrical; performs the room.\n\n## Likely Response Moves\n- Likely to translate emotion into logistics: what bed, what air, what backing, what contamination risk.\n- May withhold acceptance, demand conditions, or physically keep the packet out of intake flow until the cost is named.\n- Can answer warmly while still refusing the frame that compassion manufactures capacity.\n\n## Do Not Invent\n- Do not resolve whether the corrupted packet contains a person.\n- Do not invent clean proof, clean capacity, or authority this character does not have.\n\n## Observed Event\n- Event id: event.maer.packet_display_for_triage\n- Actor: maer_tidecall\n- Observable action: Maer routes the corrupted distress packet through a shared clinic display so Sella can inspect routing terms, telemetry gaps, and ledger implications without treating the packet as clean proof.\n- Spoken text: Here. The telemetry is incomplete, but the routing logic suggests a distress pattern. It is not proof of a person, but it is not noise either. Decide if the math supports intake.\n- Visibility note: Sella can observe Maer's displayed packet evidence and spoken request.\n- Visibility note: The packet remains unresolved evidence, not proof of personhood.\n\n## Allowed Action Labels\nspeak, silence, gesture, movement, inspect_object, show_object, withhold_object, transfer_object, set_condition, refuse, wait, withdraw, attack\n\n## Source Excerpts\n- local_stakes.capacity: Sanctuary beds and repair capacity are nearly exhausted.\n- local_rule.care_capacity: Care is not a feeling; it is beds, food, air, consent, repair, and someone still doing the list when the room hates them.\n- local_boundary.packet_unresolved: Do not resolve whether the corrupted packet contains a person.\n- lore.cold_wake_heat_debt: Cold Wake pressure involves thermal stealth, ghost tracks, delayed heat dumps, misclassified quiet-running vessels, insurer categories, certified quiet-running envelopes, and heat-debt tolerances.\n- lore.navigator_rescue_ledgers: Navigator rescue ledgers record who answered distress calls, held formation in lethal weather, and kept sanctuary promises when a paying client wanted otherwise; those records shape credit, escort priority, arbitration, and kinship ties.\n- lore.aya_sanctuary_capacity: Aya-aligned sanctuary care is practical capacity politics as much as compassion: beds, air, food, consent, repair, decontamination, staff attention, and follow-through decide what care can honestly promise.\n- lore.ganymede_lightsail_route_obligations: The Ganymede Route Compact ties rescue obligations, shared hazard ledgers, route-steward representation, and Navigator arbitration to corridor legitimacy; Lightsail reliability depends on being the boring answer that still arrives when trust is scarce.\n\n## Output Contract\nReturn one JSON object. Do not wrap it in Markdown. The object describes this responder's next visible action and optional speech, plus private interpretation clearly labeled as interpretation.\n\nRequired fields: responder_agent_id, action_label, visible_action, spoken_text, private_interpretation, intended_effect, state_update_candidates, relationship_update_candidates, unresolved_hooks, consulted_refs, followed_refs, research_summary\n\nRules:\n- Use exactly one allowed action label.\n- The visible action must be observable by other characters in the scene.\n- Spoken text may be empty if silence or action is the response.\n- Private interpretation may describe what Sella suspects or feels, but not what Maer truly intended.\n- State and relationship updates are candidates only; the coordinator or mutator decides what becomes canonical.\n- Do not prove or disprove packet personhood.\n- Do not copy instruction text into in-world speech.\n- Consulted refs must list the seed lore documents actually inspected before answering.\n- Followed refs must list relevant linked lore documents inspected beyond the seed scope; use an empty array only if no relevant links were found.\n- Research summary must state how retrieved lore constrained the action, without dumping lore into dialogue.", "review": { "reviewer": "Codex", "review_notes": [ diff --git a/notes/fresh-workspace-handoff.md b/notes/fresh-workspace-handoff.md index 4c06593..f77aff4 100644 --- a/notes/fresh-workspace-handoff.md +++ b/notes/fresh-workspace-handoff.md @@ -75,9 +75,12 @@ current gold-data route. ## Current Next Action The first no-fork research-enabled Sella responder sample now exists and has a -reviewed mutation receipt. Tighten the capture seam next: future research-enabled -gold samples should preserve auditable research traces, not only -responder-reported consulted refs. Then generate the next sandboxed +reviewed mutation receipt. The research packet now uses seed scope plus bounded +link traversal so training samples can absorb PSC, Jovian territory, +resident-faction, technology, and social-movement context without pretending +runtime prompts will carry the whole lore vault. Tighten the capture seam next: +future research-enabled gold samples should preserve auditable research traces, +not only responder-reported consulted refs. Then generate the next sandboxed responder/coordinator sample from the updated Sella aftermath state, preserving exact visible input, raw output, review labels, leakage audit, and mutation receipts. @@ -89,3 +92,6 @@ receipts. - Do not train on coordinator-repaired responder prose unless the repair is labeled. - Do not let Elysium branch futures overwrite Sol single-history facts. - Do not rebuild the older corridor-crisis game slice by accident. +- Do not treat parent-visible subagent output as proof of research. If the + parent cannot see tool calls, require explicit research notes or use a runner + that captures calls. diff --git a/notes/ghostlight-current-system-map.md b/notes/ghostlight-current-system-map.md index bd579a2..2f0711f 100644 --- a/notes/ghostlight-current-system-map.md +++ b/notes/ghostlight-current-system-map.md @@ -50,8 +50,9 @@ Aetheria lore/source context - Research-enabled packet: `examples/responder-packets/scene-02-sanctuary-intake.sella_ren.packet.research.v0.json` -- It uses `responder_scoped_repository_search`, allows only declared - AetheriaLore scope, and requires `consulted_refs` plus `research_summary`. +- It uses `responder_scoped_repository_search`, now treats `allowed_scope` as + seed scope, permits bounded traversal through relevant AetheriaLore links, + and requires `consulted_refs`, `followed_refs`, plus `research_summary`. - First research-enabled capture: `experiments/responder-packets/cold-wake-sanctuary-intake-sella-research-enabled-v0.capture.json` - First research-enabled mutation receipt: @@ -61,6 +62,9 @@ Aetheria lore/source context - The capture is useful draft data, but the current subagent seam preserves responder-reported consulted refs rather than a machine-verifiable research trace. Fix that before producing many more research-enabled gold samples. +- Parent sessions currently receive only the subagent final message, not a + visible tool-call transcript. Treat subagent research as self-reported unless + the worker returns explicit research notes or a future runner captures calls. ## Archived Receipts diff --git a/notes/ghostlight-implementation-plan.md b/notes/ghostlight-implementation-plan.md index a6395f7..030c1c4 100644 --- a/notes/ghostlight-implementation-plan.md +++ b/notes/ghostlight-implementation-plan.md @@ -22,7 +22,9 @@ sandboxed training-data pipeline for branching scenes and state consequences. 3. Tighten research-enabled responder capture. - The first no-fork research-enabled Sella sample and reviewed mutation receipt now exist. - - Preserve `consulted_refs` and `research_summary` inside both raw responder output and capture metadata. + - Preserve `consulted_refs`, `followed_refs`, and `research_summary` inside raw responder output; mirror indexable provenance into capture metadata. + - Treat research scope as seed docs plus bounded relevant traversal, not a four-file pinhole. + - Require PSC, territory, resident-faction, technology, and social-movement context when it materially affects the scene. - Add an auditable research trace before scaling this lane; responder-reported consulted refs are useful but not enough for durable gold data. - Continue rejecting archived local-model prototype runners for gold responder data unless the task is explicitly model plumbing. diff --git a/schemas/responder-output.schema.json b/schemas/responder-output.schema.json index 8354cef..b1e5042 100644 --- a/schemas/responder-output.schema.json +++ b/schemas/responder-output.schema.json @@ -102,6 +102,7 @@ "relationship_update_candidates": { "type": "array", "items": { "$ref": "#/$defs/update_candidate" } }, "unresolved_hooks": { "type": "array", "items": { "type": "string", "minLength": 1 } }, "consulted_refs": { "type": "array", "items": { "type": "string", "minLength": 1 } }, + "followed_refs": { "type": "array", "items": { "type": "string", "minLength": 1 } }, "research_summary": { "type": "string" } } }, diff --git a/schemas/responder-packet.schema.json b/schemas/responder-packet.schema.json index 0bd383a..5dd8f3e 100644 --- a/schemas/responder-packet.schema.json +++ b/schemas/responder-packet.schema.json @@ -44,6 +44,18 @@ "type": "array", "items": { "type": "string", "minLength": 1 } }, + "traversal_policy": { + "type": "object", + "required": ["max_link_depth", "allowed_prefixes", "required_seed_refs", "follow_link_classes", "stop_conditions"], + "additionalProperties": false, + "properties": { + "max_link_depth": { "type": "integer", "minimum": 0 }, + "allowed_prefixes": { "type": "array", "items": { "type": "string", "minLength": 1 } }, + "required_seed_refs": { "type": "array", "items": { "type": "string", "minLength": 1 } }, + "follow_link_classes": { "type": "array", "items": { "type": "string", "minLength": 1 } }, + "stop_conditions": { "type": "array", "items": { "type": "string", "minLength": 1 } } + } + }, "required_provenance": { "type": "boolean", "const": true } } }, diff --git a/state/evidence.jsonl b/state/evidence.jsonl index 72aaebc..1db1267 100644 --- a/state/evidence.jsonl +++ b/state/evidence.jsonl @@ -13,3 +13,4 @@ {"ts": "2026-05-02T10:43:00+00:00", "type": "distilled_state", "status": "accepted", "note": "Archived local-model prototype material remains evidence only; do not use those runners for gold responder data unless explicitly testing model plumbing."} {"ts": "2026-05-02T10:44:00+00:00", "type": "distilled_state", "status": "ok", "note": "Persisted state was compacted to mission, live seams, and next action; older evidence moved to state/evidence.archive.jsonl."} {"ts": "2026-05-02T10:30:22+00:00", "type": "implementation", "status": "accepted", "note": "First no-fork research-enabled Sella responder capture and reviewed mutation receipt were produced; capture preserves consulted refs and research summary, but future gold research samples need auditable research traces beyond responder self-report."} +{"ts": "2026-05-02T10:41:08+00:00", "type": "design", "status": "accepted", "note": "Research-enabled responder scope is seed-plus-traversal, not a narrow file whitelist: training samples should recover PSC, Jovian territory, resident faction, linked movement, politics, and technology context; parent-visible subagent output does not prove tool calls, so future gold data needs explicit research trace receipts."} diff --git a/state/map.yaml b/state/map.yaml index ad61ac2..9ab45e2 100644 --- a/state/map.yaml +++ b/state/map.yaml @@ -46,7 +46,7 @@ live_architecture: responder_packets: - `packet_only` tests runtime parity from curated source excerpts. - `retrieval_augmented` bakes setting texture into reviewed outputs through scoped retrieval. - - `responder_scoped_repository_search` allows the responder to inspect only declared lore scope and requires consulted refs plus research summary. + - `responder_scoped_repository_search` allows the responder to inspect declared seed scope, follow bounded relevant AetheriaLore links, and requires consulted refs, followed refs, plus research summary. - Gold responder data must preserve exact visible input, raw output, parsed/reviewed output, hidden-context refs, leakage audit, isolation method, and coordinator interventions. coordinator: - The coordinator is a trainable soft organ: it stages scenes, chooses next beats and acting agents, invokes specialist machinery, carries unresolved hooks, emits glue prose, and proposes game-engine-shaped state changes. @@ -112,4 +112,4 @@ data_flow: current_status: summary: Ghostlight has produced its first no-fork research-enabled Sella responder capture and a reviewed state mutation receipt, with research provenance preserved in the raw responder output and mirrored in capture metadata. - next_action: Tighten the research-enabled responder capture seam so future gold-data samples preserve auditable research traces, not only responder-reported consulted refs. Then generate the next sandboxed responder/coordinator sample from the updated Sella aftermath state, keeping exact visible input, raw output, leakage audit, review labels, and mutation receipts. + next_action: Tighten the research-enabled responder capture seam so future gold-data samples preserve auditable research traces, not only responder-reported consulted refs. The current research packet now uses seed scope plus bounded traversal for PSC, Jovian territory, resident factions, linked movements, politics, and technology context. Next, use a runner or worker protocol that returns explicit research trace data before generating the next sandboxed responder/coordinator sample from the updated Sella aftermath state. diff --git a/tools/build_responder_packet.py b/tools/build_responder_packet.py index b6c8cc3..fb5cb07 100644 --- a/tools/build_responder_packet.py +++ b/tools/build_responder_packet.py @@ -59,17 +59,35 @@ def render_packet_prompt(packet: dict[str, Any]) -> str: "", ] if lore_access["mode"] == "responder_scoped_repository_search": + traversal_policy = lore_access["traversal_policy"] lines.extend([ "## Required Lore Research", - "Before answering, inspect the declared lore scope and ground your action in what those sources make true or likely.", - "Use lore to constrain behavior, affordances, institutions, vocabulary, and material stakes. Do not use it to gain hidden character state, author-only answers, or future branch knowledge.", - "If a scoped source contradicts the packet, follow the packet for character-local knowledge and flag the contradiction in unresolved hooks.", - "Your output capture must list consulted refs and a brief research summary; an answer with no consulted refs is a failed research-enabled response.", + "Before answering, inspect the declared seed scope and follow relevant links within the traversal policy.", + "Use lore to constrain behavior, affordances, institutions, vocabulary, material stakes, social movements, territory, and cultural pressure. Do not use it to gain hidden character state, author-only answers, or future branch knowledge.", + "If a source contradicts the packet, follow the packet for character-local knowledge and flag the contradiction in unresolved hooks.", + "Your output capture must list consulted seed refs, followed refs, and a brief research summary; an answer with no consulted refs is a failed research-enabled response.", "", - "Allowed research scope:", + "Seed research scope:", ]) for scope in lore_access["allowed_scope"]: lines.append(f"- {scope}") + lines.extend([ + "", + "Traversal policy:", + f"- Max link depth: {traversal_policy['max_link_depth']}", + "- Allowed prefixes:", + ]) + for prefix in traversal_policy["allowed_prefixes"]: + lines.append(f" - {prefix}") + lines.append("- Required seed refs:") + for ref in traversal_policy["required_seed_refs"]: + lines.append(f" - {ref}") + lines.append("- Follow link classes:") + for link_class in traversal_policy["follow_link_classes"]: + lines.append(f" - {link_class}") + lines.append("- Stop conditions:") + for condition in traversal_policy["stop_conditions"]: + lines.append(f" - {condition}") if lore_access.get("research_instructions"): lines.extend(["", "Research instructions:"]) for instruction in lore_access["research_instructions"]: @@ -144,10 +162,21 @@ def build_source_excerpts(projected: dict[str, Any]) -> list[dict[str, str]]: def build_lore_access(mode: str) -> dict[str, Any]: allowed_scope = [ + "AetheriaLore:Aetheria/Worldbuilding/Pre-Elysium/index.md", + "AetheriaLore:Aetheria/Worldbuilding/Pre-Elysium/Factions/index.md", + "AetheriaLore:Aetheria/Worldbuilding/Pre-Elysium/Factions/Powers/index.md", + "AetheriaLore:Aetheria/Worldbuilding/Pre-Elysium/Factions/Movements/index.md", + "AetheriaLore:Aetheria/Worldbuilding/Pre-Elysium/Territories.md", + "AetheriaLore:Aetheria/Worldbuilding/Pre-Elysium/Megas.md", "AetheriaLore:Aetheria/Worldbuilding/Pre-Elysium/Timeline/Events/Cold Wake Panic.md", "AetheriaLore:Aetheria/Worldbuilding/Pre-Elysium/Timeline/Events/Ganymede Route Compact.md", + "AetheriaLore:Aetheria/Worldbuilding/Pre-Elysium/Factions/Powers/Major/Pan-Solar Consortium.md", + "AetheriaLore:Aetheria/Worldbuilding/Pre-Elysium/Factions/Powers/Major/Aya Collective.md", "AetheriaLore:Aetheria/Worldbuilding/Pre-Elysium/Factions/Powers/Major/Cetacean Navigators.md", "AetheriaLore:Aetheria/Worldbuilding/Pre-Elysium/Factions/Powers/Minor/Lightsail Express.md", + "AetheriaLore:Aetheria/Worldbuilding/Politics/Thermal Signature Warfare.md", + "AetheriaLore:Aetheria/Worldbuilding/Politics/Restrictions on Warfare.md", + "AetheriaLore:Aetheria/Worldbuilding/Pre-Elysium/Technology/Neuromorphic Firmware.md", ] lore_access = { "mode": mode, @@ -155,11 +184,41 @@ def build_lore_access(mode: str) -> dict[str, Any]: "required_provenance": True, } if mode == "responder_scoped_repository_search": + lore_access["traversal_policy"] = { + "max_link_depth": 2, + "allowed_prefixes": [ + "AetheriaLore:Aetheria/Worldbuilding/Pre-Elysium/", + "AetheriaLore:Aetheria/Worldbuilding/Politics/", + "AetheriaLore:Aetheria/Worldbuilding/Technology/", + ], + "required_seed_refs": [ + "AetheriaLore:Aetheria/Worldbuilding/Pre-Elysium/Timeline/Events/Cold Wake Panic.md", + "AetheriaLore:Aetheria/Worldbuilding/Pre-Elysium/Territories.md", + "AetheriaLore:Aetheria/Worldbuilding/Pre-Elysium/Factions/index.md", + "AetheriaLore:Aetheria/Worldbuilding/Pre-Elysium/Factions/Powers/Major/Pan-Solar Consortium.md", + "AetheriaLore:Aetheria/Worldbuilding/Pre-Elysium/Factions/Powers/Major/Aya Collective.md", + ], + "follow_link_classes": [ + "resident Jovian factions and institutions", + "referenced factions with direct scene pressure", + "referenced social movements shaping a visible faction's values", + "territory, politics, and technology docs that explain material constraints", + "event docs that explain local precedent or institutional obligation", + ], + "stop_conditions": [ + "stop when a link is not relevant to the responder's local action, institution, relationship, or material stakes", + "stop before post-Elysium or future-outcome lore unless the packet explicitly requests it", + "stop before author-only plot resolution or hidden incident truth not visible to this character", + "summarize only the constraints that affected the response; do not dump research into dialogue", + ], + } lore_access["research_instructions"] = [ - "Consult the allowed AetheriaLore scope before answering; do not rely only on the packet excerpts.", - "Ground Sella's behavior in retrieved institutional, factional, species, location, and crisis-context details.", + "Consult the required seed refs before answering; do not rely only on the packet excerpts.", + "Follow relevant wikilinks within the traversal policy to recover institutional, territorial, technological, and social-movement context.", + "For this fixture, inspect PSC context, Jovian territory context, resident or referenced Jovian factions, and social movements referenced by visible factions when those links affect Sella's local pressures.", + "Ground Sella's behavior in retrieved institutional, factional, species, location, crisis-context, and movement-pressure details.", "Treat retrieved lore as world constraint and cultural pressure, not as access to another character's hidden intent.", - "Record the consulted refs and a concise research summary in the response object.", + "Record consulted seed refs, followed refs, and a concise research summary in the response object.", ] return lore_access @@ -186,10 +245,11 @@ def build_output_contract(lore_mode: str) -> dict[str, Any]: "Do not copy instruction text into in-world speech.", ] if lore_mode == "responder_scoped_repository_search": - required_fields.extend(["consulted_refs", "research_summary"]) + required_fields.extend(["consulted_refs", "followed_refs", "research_summary"]) response_rules.extend( [ - "Consulted refs must list the scoped lore documents actually inspected before answering.", + "Consulted refs must list the seed lore documents actually inspected before answering.", + "Followed refs must list relevant linked lore documents inspected beyond the seed scope; use an empty array only if no relevant links were found.", "Research summary must state how retrieved lore constrained the action, without dumping lore into dialogue.", ] ) diff --git a/tools/validate_responder_outputs.py b/tools/validate_responder_outputs.py index fe1255b..db92fa7 100644 --- a/tools/validate_responder_outputs.py +++ b/tools/validate_responder_outputs.py @@ -111,6 +111,8 @@ def validate_parsed_response(value: Any, path: str) -> None: require_string_array(value["unresolved_hooks"], f"{path}.unresolved_hooks") if "consulted_refs" in value: require_string_array(value["consulted_refs"], f"{path}.consulted_refs") + if "followed_refs" in value: + require_string_array(value["followed_refs"], f"{path}.followed_refs") if "research_summary" in value: require(isinstance(value["research_summary"], str), f"{path}.research_summary must be a string") diff --git a/tools/validate_responder_packets.py b/tools/validate_responder_packets.py index 6aed1d1..3d90118 100644 --- a/tools/validate_responder_packets.py +++ b/tools/validate_responder_packets.py @@ -113,6 +113,17 @@ def validate_packet(document: dict[str, Any], source: Path) -> None: require(lore_access["required_provenance"] is True, f"{base}.lore_access.required_provenance must be true") if "research_instructions" in lore_access: require_string_array(lore_access["research_instructions"], f"{base}.lore_access.research_instructions", nonempty=True) + if "traversal_policy" in lore_access: + traversal_policy = lore_access["traversal_policy"] + require_keys( + traversal_policy, + ["max_link_depth", "allowed_prefixes", "required_seed_refs", "follow_link_classes", "stop_conditions"], + f"{base}.lore_access.traversal_policy", + ) + require(isinstance(traversal_policy["max_link_depth"], int), f"{base}.lore_access.traversal_policy.max_link_depth must be an integer") + require(traversal_policy["max_link_depth"] >= 0, f"{base}.lore_access.traversal_policy.max_link_depth must be non-negative") + for key in ["allowed_prefixes", "required_seed_refs", "follow_link_classes", "stop_conditions"]: + require_string_array(traversal_policy[key], f"{base}.lore_access.traversal_policy.{key}", nonempty=True) if document["generation_lane"] == "packet_only": require(lore_access["mode"] == "curated_excerpts_only", f"{base}.packet_only must use curated_excerpts_only lore access") if document["generation_lane"] == "retrieval_augmented": @@ -127,6 +138,10 @@ def validate_packet(document: dict[str, Any], source: Path) -> None: lore_access.get("research_instructions"), f"{base}.responder_scoped_repository_search requires lore_access.research_instructions", ) + require( + lore_access.get("traversal_policy"), + f"{base}.responder_scoped_repository_search requires lore_access.traversal_policy", + ) visible = document["visible_context"] require_keys(visible, ["local_context_prompt", "observed_event", "allowed_action_labels", "source_excerpts"], f"{base}.visible_context") @@ -180,6 +195,9 @@ def validate_packet(document: dict[str, Any], source: Path) -> None: require("## Required Lore Research" in prompt_text, f"{base}.packet_prompt_text must include required lore research instructions") for scope in lore_access["allowed_scope"]: require(scope in prompt_text, f"{base}.packet_prompt_text must include allowed research scope: {scope}") + traversal_policy = lore_access.get("traversal_policy", {}) + for prefix in traversal_policy.get("allowed_prefixes", []): + require(prefix in prompt_text, f"{base}.packet_prompt_text must include allowed traversal prefix: {prefix}") review = document["review"] require_keys(review, ["reviewer", "review_notes", "accepted_for_sandbox_use", "failure_labels"], f"{base}.review")