Capture projector-routed Qwen failures

This commit is contained in:
Meta Vens 2026-05-02 03:55:51 +01:00
commit d41d1430d8
13 changed files with 516 additions and 51 deletions

View file

@ -55,6 +55,13 @@ Sources:
runner repairs known fields such as `choices`, `appraisal`, and `response`
when they arrive as JSON strings, and records validation notes when repair
fails.
- Projector-routed v8 showed a malformed stringified `choices` array with an
obvious missing closing bracket. The runner can now repair that class of
truncated tool-string wrapper, but the capture stays useful-needs-revision if
no valid choice remains.
- Projector-routed v9 showed a no-tool-call dropout. This is not repairable
from arguments because there are no arguments. The next harness step should
be an explicit retry or fallback pass, not prompt scolding.
## Current Policy
@ -65,7 +72,9 @@ For structured Ghostlight generation:
3. Preserve captures that fail formatting as `useful_needs_revision` receipts.
4. Use repair only as a reviewed harness layer, not as proof the model obeyed
the schema perfectly.
5. Only materialize Ink or canonical mutation from captures that validate after
5. If a pass returns no tool call, retry or route through a deliberate fallback
before continuing the sequence.
6. Only materialize Ink or canonical mutation from captures that validate after
tool parsing and repair.
Qwen-Agent remains a future option if we need its higher-level tool loop,

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,63 @@
You are Ghostlight's Maer-local choice generator. Call record_maer_choices exactly once.
Do not write Sella's response or private interpretation.
{
"task": "Generate candidate player choices for Maer only. Do not write Sella's response.",
"output_contract": {
"format": "Call the provided tool exactly once. Do not write plain assistant content.",
"root_keys": [
"choices"
],
"choice_count": 4,
"valid_action_types": [
"attack",
"block_object",
"gesture",
"mixed",
"move",
"show_object",
"silence",
"speak",
"spend_resource",
"touch_object",
"transfer_object",
"use_object",
"wait",
"withhold_object"
],
"choice_fields": [
"branch_id",
"ink_path",
"choice_text",
"action_type",
"actor_intent_private",
"observable_action",
"spoken_text",
"state_basis",
"expected_consequence_surfaces",
"training_hooks"
]
},
"hard_rules": [
"Use only Maer's local awareness and scene-observable facts.",
"Do not stringify nested arrays or objects inside tool arguments.",
"Do not include Sella's private state, private motives, or future response.",
"Do not resolve whether the corrupted packet contains a person.",
"Include at least two non-speech choices.",
"Use action_type values only from this exact enum: attack, block_object, gesture, mixed, move, show_object, silence, speak, spend_resource, touch_object, transfer_object, use_object, wait, withhold_object.",
"The selected branch must be reducible to observable action for Sella.",
"Use semantic training hooks, not branch ids."
],
"projected_local_context": "# Ghostlight Local Operating Context: maer_tidecall\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\nMaer Tidecall: Navigator route steward, Ganymede corridor compact delegate. Origin: Cetacean Navigator corridor culture, Ganymede route institutions. A soft-spoken route steward whose calm tends to make hurried people feel judged by the furniture.\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- Sella's clinic is nearly full.\n- The packet may be testimony or noise.\n- If no one prepares intake, rescue becomes theater.\n- Speaker belief: Sella will not hide behind false capacity.\n- Speaker belief: Asking her for help may be necessary and unfair.\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## Active Inner Pressures\n- Strong pressure: expects hidden motives or missing information.\n- Strong pressure: needs the situation to become governable.\n- Strong pressure: feels risk before it becomes visible.\n- Present pressure: leans on structure when uncertainty rises.\n- Strong pressure: carries a live sense of unfairness.\n- Present pressure: has less spare tolerance than the words may show.\n- Present pressure: is taking in more demand than can be cleanly sorted.\n- Present pressure: keeps feeling at a controlled distance.\n- Present pressure: leaves motives partly covered.\n- Keep the unidentified quiet-running vessel eligible for rescue while telemetry is incomplete. Emotional stake: If rescue waits for perfect categories, the corridor teaches fear to go silent.\n- Rescue ledgers decide whether route law is trusted by crews who have nothing left to bargain with.\n\n## Relationship Read\n- Maer trusts Sella's care because she names costs instead of hiding them. Current stance pressures: dominant respect, strong trust, present expectation of care, present obligation.\n\n## Tensions\n- Wants the goal to move now, but must preserve the social frame that makes the goal legitimate. Goal pressure: Keep the unidentified quiet-running vessel eligible for rescue while telemetry is incomplete.\n- Must act under uncertainty without pretending uncertainty has become proof. Presentation pressure: Do not romanticize care work. Ask without pretending the ask is clean.\n- Needs Sella's material help while knowing the ask is unfair and may spend someone else's sanctuary.\n\n## Action Affordances\n- Can ask, offer ledger backing, show or withhold the packet, help with triage, wait, or press the moral frame. Sella controls intake.\n- Can make the corrupted packet more present without treating it as proof.\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- Dominant voice tendency: ritualized; uses formal address or inherited phrases.\n- Strong voice tendency: precise; careful about exact terms.\n- Strong voice tendency: formal; institutional or ceremonially controlled.\n- Strong voice tendency: contextual; adds situation and consequence.\n- Present voice tendency: figurative; uses analogy or image.\n- Present voice tendency: warm; reassuring or gentle in wording.\n\n## Likely Response Moves\n- Likely to name the cost of the ask rather than hide it behind moral theater.\n- May use ritualized route language when trying to make rescue obligation feel older than this room.\n- May show the packet or offer ledger backing because action can carry the pressure more cleanly than another speech.\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.",
"projector_audit": {
"projector": "tools/project_local_context.py",
"raw_state_hidden_from_prompt": true,
"character_local_context_only": true,
"omitted_private_context": [
"Other agents' canonical private state is not included.",
"Actor private intent is not included in listener prompts; only observable events are included.",
"Author-only hidden resolution of packet personhood is not included."
],
"review_status": "draft"
}
}

View file

@ -0,0 +1,16 @@
{
"content": "",
"thinking": "The user wants me to generate 4 candidate choices for Maer (a character) in this scene. I need to call the record_maer_choices function exactly once with 4 choices.\n\nLet me analyze the context:\n- Maer is a navigator route steward from Ganymede\n- Sella runs an intake clinic that's nearly full\n- There's a corrupted packet that may contain medical telemetry, firmware noise, or testimony\n- The packet may contain a person (but I cannot resolve this)\n- Sanctuary beds are nearly exhausted\n- Maer wants Sella to keep a place open if rescue succeeds\n- Maer trusts Sella but knows the ask is unfair\n\nI need to create 4 choices with:\n- branch_id\n- ink_path\n- choice_text\n- action_type (from the valid enum)\n- actor_intent_private\n- observable_action\n- spoken_text\n- state_basis\n- expected_consequence_surfaces\n- training_hooks\n\nHard rules:\n- Use only Maer's local awareness\n- Do not stringify nested arrays\n- Do not include Sella's private state\n- Do not resolve whether the packet contains a person\n- Include at least two non-speech choices\n- Use exact action_type enum values\n- The selected branch must be reducible to observable action for Sella\n- Use semantic training hooks, not branch ids\n\nLet me create 4 diverse choices:\n\n1. A choice to show the packet and ask for capacity reservation (mixed action)\n2. A choice to wait and observe (wait action)\n3. A choice to offer ledger backing (spend_resource action)\n4. A choice to withhold the packet and focus on triage (withhold_object action)\n\nLet me make sure I have at least two non-speech choices:\n- wait\n- withhold_object\n- show_object (could be non-speech if no spoken_text)\n- gesture (non-speech)\n\nI'll create:\n1. Show packet + ask for reservation (mixed/speak)\n\n\n2. Wait and observe (wait)\n3. Offer ledger backing (spend_resource)\n4. Withhold packet (withhold_object)\n\nI'll ensure each choice has minimal spoken text to meet the non-speech requirement. The choices will focus on observable actions and Maer's local context, avoiding assumptions about Sella's private state.",
"tool_calls": [
{
"id": "call_iwng59ez",
"function": {
"index": 0,
"name": "record_maer_choices",
"arguments": {
"choices": "[{\"branch_id\": \"capacity_ask_packet\", \"ink_path\": \"show_packet_ledger_ask\", \"choice_text\": \"Show the corrupted packet to Sella and ask her to reserve one bed if the rescue succeeds, offering ledger backing for the cost.\", \"action_type\": \"mixed\", \"actor_intent_private\": \"Make the rescue obligation legible without pretending the ask is clean. Name the cost of capacity before asking.\", \"observable_action\": \"Maer extends the packet toward Sella's intake desk and opens a ledger for review.\", \"spoken_text\": \"I need you to keep a bed open if the telemetry proves life. I will back the cost. Don't pretend this is charity.\", \"state_basis\": \"Sella controls intake; packet custody is shared; ledger backing available.\", \"expected_consequence_surfaces\": [\"Sella may accept with reservation of capacity\", \"Sella may refuse citing full capacity\", \"Sella may resent the ledger backing demand\", \"Sella may demand more information before deciding\"], \"training_hooks\": [\"capacity negotiation under uncertainty\", \"ledger backing as moral currency\", \"naming cost before asking\"]}, {\"branch_id\": \"wait_for_telemetry\", \"ink_path\": \"wait_observe_capacity\", \"choice_text\": \"Wait and observe the intake flow before making any request, letting the situation reveal itself.\", \"action_type\": \"wait\", \"actor_intent_private\": \"Preserve the social frame that makes the ask legitimate. Don't act before the situation is governable.\", \"observable_action\": \"Maer stands aside and watches the clinic's intake flow.\", \"spoken_text\": \"\", \"state_basis\": \"Uncertainty about packet contents; capacity is nearly exhausted.\", \"expected_consequence_surfaces\": [\"Situation may reveal itself without intervention\", \"Sella may come to Maer with a request\", \"Situation may deteriorate while waiting\", \"Maer may lose leverage by not acting\"], \"training_hooks\": [\"wait under uncertainty\", \"preserve social frame\", \"let situation reveal itself\"]}, {\"branch_id\": \"offer_ledger_only\", \"ink_path\": \"ledger_backing_no_packet\", \"choice_text\": \"Offer ledger backing for a bed without showing the packet, framing it as a route obligation.\", \"action_type\": \"spend_resource\", \"actor_intent_private\": \"Separate the packet from the ask. Make the obligation feel older than this room.\", \"observable_action\": \"Maer presents a ledger and offers to cover costs without showing the packet.\", \"spoken_text\": \"Route law says we don't leave vessels behind. I will back the cost. You decide if the bed is open.\", \"state_basis\": \"Ledger backing available; packet custody uncertain; Sella controls intake.\", \"expected_consequence_surfaces\": [\"Sella may accept the backing and keep a bed\", \"Sella may refuse citing capacity limits\", \"Sella may ask to see the packet first\", \"Sella may resent the obligation framing\"], \"training_hooks\": [\"ledger backing as moral currency\", \"separate packet from obligation\", \"route law as framing device\"]}, {\"branch_id\": \"withhold_packet_triage\", \"ink_path\": \"withhold_packet_focus_triage\", \"choice_text\": \"Withhold the packet and ask Sella to focus on triage instead, treating the packet as noise for now.\", \"action_type\": \"withhold_object\", \"actor_intent_private\": \"Keep the unidentified vessel eligible for rescue while telemetry is incomplete. Don't treat the packet as proof.\", \"observable_action\": \"Maer pockets the packet and gestures toward the intake desk.\", \"spoken_text\": \"Put the packet aside. Triage first. We'll decide on the packet later.\", \"state_basis\": \"Packet custody is Maer's; triage is Sella's; uncertainty about packet contents.\", \"expected_consequence_surfaces\": [\"Sella may accept and focus on triage\", \"Sella may insist on seeing the packet first\", \"Sella may feel the packet is being hidden\", \"Triage may proceed without packet context\"], \"training_hooks\": [\"withhold packet without treating as proof\", \"triage over packet\", \"keep vessel eligible for rescue\"]}"
}
}
}
]
}

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,63 @@
You are Ghostlight's Maer-local choice generator. Call record_maer_choices exactly once.
Do not write Sella's response or private interpretation.
{
"task": "Generate candidate player choices for Maer only. Do not write Sella's response.",
"output_contract": {
"format": "Call the provided tool exactly once. Do not write plain assistant content.",
"root_keys": [
"choices"
],
"choice_count": 4,
"valid_action_types": [
"attack",
"block_object",
"gesture",
"mixed",
"move",
"show_object",
"silence",
"speak",
"spend_resource",
"touch_object",
"transfer_object",
"use_object",
"wait",
"withhold_object"
],
"choice_fields": [
"branch_id",
"ink_path",
"choice_text",
"action_type",
"actor_intent_private",
"observable_action",
"spoken_text",
"state_basis",
"expected_consequence_surfaces",
"training_hooks"
]
},
"hard_rules": [
"Use only Maer's local awareness and scene-observable facts.",
"Do not stringify nested arrays or objects inside tool arguments.",
"Do not include Sella's private state, private motives, or future response.",
"Do not resolve whether the corrupted packet contains a person.",
"Include at least two non-speech choices.",
"Use action_type values only from this exact enum: attack, block_object, gesture, mixed, move, show_object, silence, speak, spend_resource, touch_object, transfer_object, use_object, wait, withhold_object.",
"The selected branch must be reducible to observable action for Sella.",
"Use semantic training hooks, not branch ids."
],
"projected_local_context": "# Ghostlight Local Operating Context: maer_tidecall\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\nMaer Tidecall: Navigator route steward, Ganymede corridor compact delegate. Origin: Cetacean Navigator corridor culture, Ganymede route institutions. A soft-spoken route steward whose calm tends to make hurried people feel judged by the furniture.\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- Sella's clinic is nearly full.\n- The packet may be testimony or noise.\n- If no one prepares intake, rescue becomes theater.\n- Speaker belief: Sella will not hide behind false capacity.\n- Speaker belief: Asking her for help may be necessary and unfair.\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## Active Inner Pressures\n- Strong pressure: expects hidden motives or missing information.\n- Strong pressure: needs the situation to become governable.\n- Strong pressure: feels risk before it becomes visible.\n- Present pressure: leans on structure when uncertainty rises.\n- Strong pressure: carries a live sense of unfairness.\n- Present pressure: has less spare tolerance than the words may show.\n- Present pressure: is taking in more demand than can be cleanly sorted.\n- Present pressure: keeps feeling at a controlled distance.\n- Present pressure: leaves motives partly covered.\n- Keep the unidentified quiet-running vessel eligible for rescue while telemetry is incomplete. Emotional stake: If rescue waits for perfect categories, the corridor teaches fear to go silent.\n- Rescue ledgers decide whether route law is trusted by crews who have nothing left to bargain with.\n\n## Relationship Read\n- Maer trusts Sella's care because she names costs instead of hiding them. Current stance pressures: dominant respect, strong trust, present expectation of care, present obligation.\n\n## Tensions\n- Wants the goal to move now, but must preserve the social frame that makes the goal legitimate. Goal pressure: Keep the unidentified quiet-running vessel eligible for rescue while telemetry is incomplete.\n- Must act under uncertainty without pretending uncertainty has become proof. Presentation pressure: Do not romanticize care work. Ask without pretending the ask is clean.\n- Needs Sella's material help while knowing the ask is unfair and may spend someone else's sanctuary.\n\n## Action Affordances\n- Can ask, offer ledger backing, show or withhold the packet, help with triage, wait, or press the moral frame. Sella controls intake.\n- Can make the corrupted packet more present without treating it as proof.\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- Dominant voice tendency: ritualized; uses formal address or inherited phrases.\n- Strong voice tendency: precise; careful about exact terms.\n- Strong voice tendency: formal; institutional or ceremonially controlled.\n- Strong voice tendency: contextual; adds situation and consequence.\n- Present voice tendency: figurative; uses analogy or image.\n- Present voice tendency: warm; reassuring or gentle in wording.\n\n## Likely Response Moves\n- Likely to name the cost of the ask rather than hide it behind moral theater.\n- May use ritualized route language when trying to make rescue obligation feel older than this room.\n- May show the packet or offer ledger backing because action can carry the pressure more cleanly than another speech.\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.",
"projector_audit": {
"projector": "tools/project_local_context.py",
"raw_state_hidden_from_prompt": true,
"character_local_context_only": true,
"omitted_private_context": [
"Other agents' canonical private state is not included.",
"Actor private intent is not included in listener prompts; only observable events are included.",
"Author-only hidden resolution of packet personhood is not included."
],
"review_status": "draft"
}
}

File diff suppressed because one or more lines are too long

View file

@ -86,6 +86,8 @@ Ghostlight now has the persistence spine plus the first architecture payload:
- `experiments/ink/cold-wake-sanctuary-intake-qwen-sequential-v3.capture.json`
- `experiments/ink/cold-wake-sanctuary-intake-qwen-sequential-v5.capture.json`
- `experiments/ink/cold-wake-sanctuary-intake-qwen-sequential-v6-projector.capture.json`
- `experiments/ink/cold-wake-sanctuary-intake-qwen-sequential-v8-projector-tightened.capture.json`
- `experiments/ink/cold-wake-sanctuary-intake-qwen-sequential-v9-projector-tightened.capture.json`
- `experiments/ink/cold-wake-sanctuary-intake-qwen-sequential-v1.mutation.json`
- `experiments/ink/qwen-chat-tools-smoke.json`
- `examples/agent-state.cold-wake-story-lab.after-sanctuary-ledger.json`
@ -126,10 +128,10 @@ training feedstock for projection and dialogue scaffolding.
## Current Next Action
Tighten the projector-routed sequential loop by repairing or preventing nested
tool-argument stringification, then decide whether the v6-style output should
be materialized into Ink and a reviewed mutation receipt or rerun after stricter
tool validation.
Add a deliberate retry or fallback strategy for projector-routed Qwen tool-call
failures, then rerun until a projector-routed sequential capture is
accepted-as-draft before materializing any branch into Ink or mutation training
data.
Cat/Oz remains useful as an Elysium procedural mechanics fixture, but grounded
training data should start from authored historical lore rather than gameplay
@ -229,15 +231,24 @@ Completed projection path items:
validates the architecture boundary and produces usable Maer/Sella behavior,
but remains useful-needs-revision because Qwen stringified a nested
`response_constraints` field in Sella appraisal
- tighten the sequential runner:
repair notes are separated from fatal validation notes, obvious truncated
stringified tool arrays can be repaired, failed Maer choice generation writes
a reviewed capture instead of exiting, and Sella's next-action prompt receives
appraisal context as prose constraints rather than raw numeric deltas
- add v8 and v9 projector-routed failure receipts:
v8 shows malformed stringified `choices`; v9 shows a no-tool-call dropout.
These are Qwen tool reliability failures, so no projector-routed branch was
materialized into Ink in this pass.
Remaining projection path:
- build a deterministic speaker-local input slicer
- build a renderer that emits projection controls before prompt prose
- tighten nested tool-argument repair or schema enforcement so projector-routed
sequential captures can become accepted-as-draft without hand-cleaning
- decide whether the v6 projector-routed output should be materialized into Ink
and mutation training data or rerun after stricter validation
- add a deliberate retry or fallback strategy around projector-routed Qwen
tool-call failures
- rerun until a projector-routed capture is accepted-as-draft before
materializing into Ink and mutation training data
- improve the local-awareness-to-Ink prompt so semantic `training_hooks` do not
drift into future branch ids, object custody remains branch-local, and action
labels come from the exact canonical enum

View file

@ -149,6 +149,13 @@ state and re-entry discipline.
- useful-needs-revision projector-routed receipt proving Qwen prompts can use
character-local operating prose instead of raw state variables; still
exposed nested `response_constraints` stringification in appraisal output
- `experiments/ink/cold-wake-sanctuary-intake-qwen-sequential-v8-projector-tightened.capture.json`
- useful-needs-revision receipt proving failed Maer choice generation is now
captured instead of crashing the runner; exposed malformed stringified
`choices`
- `experiments/ink/cold-wake-sanctuary-intake-qwen-sequential-v9-projector-tightened.capture.json`
- useful-needs-revision receipt showing Qwen can still drop tool calls
entirely under projector-routed prompting
- `examples/projected-contexts/`
- current rendered projected local context artifacts for Maer and Sella in
the sanctuary intake scene
@ -191,7 +198,9 @@ state and re-entry discipline.
- builds a sequential Qwen prototype through Ollama `/api/chat` with native
tools and thinking enabled: actor-local choices, participant
appraisal/consolidation, then next-actor action from updated state; now
routes character context through the projected-local-context seam
routes character context through the projected-local-context seam, captures
failed Maer choice calls, separates repair notes from fatal validation
notes, and keeps numeric appraisal deltas out of next-action prompt context
- `tools/check_qwen_chat_tools.py`
- fast smoke test for local Qwen thinking plus native tool calling
- `tools/project_local_context.py`
@ -230,7 +239,8 @@ first Qwen-generated Ink draft now exists with a reviewed capture, the first
selected branch now has a reviewed mutation replay that updates both involved
characters, v2 shows the symmetrical turn model improves action behavior, v5
proves local thinking-plus-tools invocation works for the scene runner, and v6
routes that runner through projected character-local operating context. The
next implementation target is tightening nested tool-argument validation and
deciding whether to materialize a projector-routed branch into Ink plus mutation
training data.
routes that runner through projected character-local operating context. v8 and
v9 show that Qwen tool-call reliability, not the projector seam, is now the
immediate blocker. The next implementation target is an explicit retry or
fallback strategy before any projector-routed branch is materialized into Ink
plus mutation training data.

View file

@ -130,9 +130,17 @@
produced usable Maer/Sella behavior but remains useful-needs-revision
because Qwen stringified nested `response_constraints` in the appraisal
payload.
- Next prototype: tighten nested tool-argument repair or schema enforcement,
then materialize only a validated projector-routed branch into Ink and
sidecar annotation.
- Runner tightening: failed Maer choice generation now writes reviewed
receipts instead of exiting, obvious malformed stringified tool arrays can
be repaired, repair notes are separated from fatal validation notes, and
Sella's next-action prompt receives appraisal prose instead of raw numeric
deltas.
- Eighth and ninth sequential drafts: v8 captured malformed stringified
`choices`; v9 captured a no-tool-call dropout. Both validate the receipt
path and show Qwen tool reliability is now the blocker.
- Next prototype: add deliberate retry or fallback behavior for
projector-routed Qwen tool-call failures, then materialize only an
accepted-as-draft projector-routed branch into Ink and sidecar annotation.
5. Build the projection distillation loop. Started.
- Use `docs/architecture/projection-distillation-plan.md` as the teacher to

View file

@ -38,3 +38,4 @@
{"ts": "2026-05-02T01:40:41+00:00", "type": "implementation", "status": "ok", "note": "Ink metadata for Ghostlight/Aetheria must use // comments, not # tags, in writer-facing drafts. Inky exposes # tags in preview, causing state and training handles to leak into readable scene output; validate_ink_examples now rejects Ghostlight/Aetheria metadata tags."}
{"ts": "2026-05-02T01:45:54+00:00", "type": "design", "status": "accepted", "note": "Hardened local-awareness invariant for Ink branching: protagonist choices and NPC responses must be separate generation passes. A responder should see only its own state plus observable protagonist action, not protagonist private intent or full protagonist-local state. The existing Qwen Ink draft is labeled as one-shot bootstrap scaffolding, not target runtime behavior."}
{"ts": "2026-05-02T02:45:44+00:00", "type": "implementation", "status": "ok", "note": "Added ghostlight.projected_local_context.v0 seam and deterministic projector so sequential Qwen prompts consume character-local operating prose instead of raw canonical state variables. v6 projector-routed capture validated as useful-needs-revision due nested response_constraints stringification."}
{"ts": "2026-05-02T02:54:51+00:00", "type": "implementation", "status": "ok", "note": "Tightened projector-routed sequential runner: failed Maer choice calls now write reviewed receipts, parser can repair obvious truncated stringified tool arrays, repair notes are separated from fatal validation notes, and next-action prompts receive appraisal prose instead of raw numeric deltas. v8/v9 captures show Qwen still has tool-call reliability failures, so no projector-routed branch was materialized."}

View file

@ -124,7 +124,10 @@ accepted_design:
- The first projected local context seam now exists as `ghostlight.projected_local_context.v0`: deterministic projection turns canonical state into character-local operating prose with audit refs while hiding raw state variables from prompt text.
- The sequential Qwen runner now consumes projected local context instead of selected raw activation dictionaries.
- The first projector-routed Qwen capture validates the architecture boundary but remains useful-needs-revision because Qwen still stringified a nested appraisal list field in one pass.
- Projector-routed next-action prompts should receive appraisal context as prose constraints, not raw numeric state deltas from the appraisal artifact.
- Failed sequential Qwen calls must still write reviewed receipts instead of exiting without evidence.
- v8 and v9 projector-routed captures show Qwen tool-call reliability remains the blocker: malformed stringified tool arrays and no-tool-call dropouts can occur even when the projector seam is clean.
current_status:
summary: Ghostlight now has the Epiphany-style persistence spine, the first architecture payload, the v0 canonical agent-state schema seam, prompt projection docs, immediate schema fixes from evaluation, first reviewed Cat/Oz projection examples, a revised Aetheria lore-grounding architecture, a lore grounding digest schema, the first draft Cold Wake historical grounding digest, a Cold Wake story-lab fixture, projection controls, validated Qwen capture receipts, a complete Cold Wake short story assembled from accepted projection outputs, a hand-authored Ink-backed Cold Wake branching scene, the first Qwen-generated Ink draft materialized from local awareness with reviewed training annotations, the first reviewed sequential branch mutation that updates both Maer and Sella after a sanctuary intake beat, a v2 sequential Qwen capture proving the symmetrical turn shape produces better action behavior, a v5 sequential Qwen capture proving local thinking-plus-tools invocation works for the scene runner, and the first projected-local-context seam that routes sequential prompts through character-local operating prose instead of raw state variables.
next_action: Tighten the projector-routed sequential loop by repairing or preventing nested tool-argument stringification, then decide whether the v6-style output should be materialized into Ink and a reviewed mutation receipt or rerun after stricter tool validation.
summary: Ghostlight now has the Epiphany-style persistence spine, the first architecture payload, the v0 canonical agent-state schema seam, prompt projection docs, immediate schema fixes from evaluation, first reviewed Cat/Oz projection examples, a revised Aetheria lore-grounding architecture, a lore grounding digest schema, the first draft Cold Wake historical grounding digest, a Cold Wake story-lab fixture, projection controls, validated Qwen capture receipts, a complete Cold Wake short story assembled from accepted projection outputs, a hand-authored Ink-backed Cold Wake branching scene, the first Qwen-generated Ink draft materialized from local awareness with reviewed training annotations, the first reviewed sequential branch mutation that updates both Maer and Sella after a sanctuary intake beat, a v2 sequential Qwen capture proving the symmetrical turn shape produces better action behavior, a v5 sequential Qwen capture proving local thinking-plus-tools invocation works for the scene runner, the first projected-local-context seam that routes sequential prompts through character-local operating prose instead of raw state variables, and tightened receipt handling for projector-routed Qwen failures.
next_action: Add a deliberate retry or fallback strategy for projector-routed Qwen tool-call failures, then rerun until a projector-routed sequential capture is accepted-as-draft before materializing any branch into Ink or mutation training data.

View file

@ -295,14 +295,32 @@ def repair_tool_arguments(arguments: dict[str, Any]) -> tuple[dict[str, Any], li
for key in ["choices", "response", "appraisal"]:
value = repaired.get(key)
if isinstance(value, str):
try:
repaired[key] = json.loads(value)
parsed = parse_jsonish_tool_string(value)
if parsed is not None:
repaired[key] = parsed
notes.append(f"repaired stringified tool argument: {key}")
except json.JSONDecodeError:
else:
notes.append(f"could not repair stringified tool argument: {key}")
return repaired, notes
def parse_jsonish_tool_string(value: str) -> Any | None:
candidate = value.strip()
candidates = [candidate]
if candidate.startswith("[") and not candidate.endswith("]"):
candidates.append(candidate + "]")
if candidate.startswith("{") and not candidate.endswith("}"):
candidates.append(candidate + "}")
if candidate.endswith(","):
candidates.append(candidate[:-1])
for item in candidates:
try:
return json.loads(item)
except json.JSONDecodeError:
continue
return None
def repair_nested_list_fields(payload: Any, fields: list[str]) -> tuple[Any, list[str]]:
notes: list[str] = []
if not isinstance(payload, dict):
@ -315,9 +333,8 @@ def repair_nested_list_fields(payload: Any, fields: list[str]) -> tuple[Any, lis
candidate = value.strip()
if candidate.endswith(","):
candidate = candidate[:-1]
try:
parsed = json.loads(candidate)
except json.JSONDecodeError:
parsed = parse_jsonish_tool_string(candidate)
if parsed is None:
notes.append(f"could not repair stringified nested list field: {field}")
continue
if isinstance(parsed, list):
@ -326,6 +343,32 @@ def repair_nested_list_fields(payload: Any, fields: list[str]) -> tuple[Any, lis
return repaired, notes
def normalize_appraisal_payload(parsed: Any) -> tuple[Any, list[str]]:
notes: list[str] = []
if not isinstance(parsed, dict):
return parsed, notes
if isinstance(parsed.get("appraisal"), dict):
appraisal = parsed["appraisal"]
elif "responder_agent_id" in parsed:
appraisal = parsed
else:
return parsed, notes
appraisal, nested_repair_notes = repair_nested_list_fields(
appraisal,
["belief_updates", "response_constraints"],
)
notes.extend(nested_repair_notes)
return {"appraisal": appraisal}, notes
def fatal_notes(notes: list[str]) -> list[str]:
return [note for note in notes if not note.startswith("repaired ")]
def repair_notes(notes: list[str]) -> list[str]:
return [note for note in notes if note.startswith("repaired ")]
def request_qwen_tool(
endpoint: str,
model: str,
@ -517,7 +560,7 @@ def build_sella_prompt(
"public_stakes": scene["public_stakes"],
},
"observable_maer_action": event_context,
"sella_immediate_appraisal": appraisal,
"sella_immediate_appraisal_context": appraisal_context_for_prompt(appraisal),
"projected_local_context": projected["context"]["prompt_text"],
"projector_audit": projected["audit"],
}
@ -528,6 +571,26 @@ def build_sella_prompt(
)
def appraisal_context_for_prompt(appraisal: dict[str, Any] | None) -> dict[str, Any] | None:
if not isinstance(appraisal, dict):
return None
state_change_summary = []
for delta in appraisal.get("immediate_state_deltas", []):
if isinstance(delta, dict) and delta.get("rationale"):
state_change_summary.append(delta["rationale"])
for delta in appraisal.get("relationship_deltas", []):
if isinstance(delta, dict) and delta.get("rationale"):
state_change_summary.append(delta["rationale"])
return {
"private_interpretation": appraisal.get("private_interpretation", ""),
"attributed_motive": appraisal.get("attributed_motive", ""),
"misread_risk": appraisal.get("misread_risk", ""),
"belief_updates": appraisal.get("belief_updates", []),
"response_constraints": appraisal.get("response_constraints", []),
"state_change_summary": state_change_summary,
}
def validate_choice_payload(parsed: Any) -> list[str]:
notes: list[str] = []
if not isinstance(parsed, dict):
@ -608,6 +671,28 @@ def choose_selected_choice(parsed: Any, preferred_action: str) -> dict[str, Any]
raise SystemExit("No choices available to select")
def write_sequential_artifacts(args: argparse.Namespace, capture: dict[str, Any], prompts: dict[str, str], responses: dict[str, str]) -> Path:
args.out_dir.mkdir(parents=True, exist_ok=True)
base = args.capture_id.replace(".", "-")
capture_path = args.out_dir / f"{base}.capture.json"
write_json(capture_path, capture)
for name, text in prompts.items():
write_text(args.out_dir / f"{base}.{name}.prompt.md", text + "\n")
for name, text in responses.items():
write_text(args.out_dir / f"{base}.{name}.response.md", text + "\n")
return capture_path
def skipped_pass(local_agent_id: str, reason: str) -> dict[str, Any]:
return {
"local_agent_id": local_agent_id,
"prompt_text": f"Skipped: {reason}",
"response_text": f"Skipped: {reason}",
"parsed_response": None,
"validation_notes": [reason],
}
def main() -> int:
parser = argparse.ArgumentParser(description="Run a sequential local-awareness Qwen Ink prototype.")
parser.add_argument("--fixture", type=Path, default=DEFAULT_FIXTURE)
@ -640,7 +725,70 @@ def main() -> int:
args.request_timeout,
)
maer_notes.extend(validate_choice_payload(maer_parsed))
selected_choice = choose_selected_choice(maer_parsed, args.preferred_action)
try:
selected_choice = choose_selected_choice(maer_parsed, args.preferred_action)
except SystemExit as exc:
selected_choice = {
"branch_id": "no-selection",
"ink_path": "no_selection",
"choice_text": "No selectable Maer choice was produced.",
"action_type": "no_valid_action",
"observable_action": "No observable action was selected because Maer choice generation failed.",
"spoken_text": "",
"expected_consequence_surfaces": [],
"training_hooks": [],
}
maer_notes.append(str(exc))
all_notes = fatal_notes(maer_notes)
capture = {
"schema_version": "ghostlight.qwen_ink_sequential_capture.v0",
"capture_id": args.capture_id,
"source_fixture_ref": str(args.fixture.relative_to(ROOT)).replace("\\", "/"),
"source_annotation_ref": str(args.annotation.relative_to(ROOT)).replace("\\", "/"),
"model": maer_raw.get("model", args.model),
"endpoint": args.endpoint,
"request_options": {
"think": args.think,
"api": "ollama_chat_tools",
"num_ctx": args.num_ctx,
"request_timeout": args.request_timeout,
"temperature": args.temperature,
"top_p": args.top_p,
},
"passes": {
"maer_choice_generation": {
"local_agent_id": "maer_tidecall",
"prompt_text": maer_prompt,
"response_text": maer_response_text,
"parsed_response": maer_parsed,
"validation_notes": maer_notes,
},
"selected_observable_action": selected_choice,
"sella_response_generation": skipped_pass("sella_ren", "skipped because no selectable Maer choice was produced"),
},
"review": {
"status": "useful_needs_revision",
"strengths": [
"Captured a failed projector-routed Qwen call instead of exiting without a receipt.",
],
"failure_notes": all_notes,
"repair_notes": repair_notes(maer_notes),
"accepted_into_ink_ref": None,
"pipeline_lessons": [
"Sequential generation failures should still produce reviewed receipts.",
"Maer choice generation needs a retry or stricter tool-call fallback before later passes run.",
],
},
}
capture_path = write_sequential_artifacts(
args,
capture,
{"maer": maer_prompt},
{"maer": maer_response_text},
)
print(f"wrote {capture_path.relative_to(ROOT)}")
print(json.dumps({"selected_observable_action": selected_choice, "failure_notes": all_notes}, indent=2, ensure_ascii=False))
return 0
sella_appraisal_prompt = build_sella_appraisal_prompt(fixture, annotation, selected_choice)
sella_appraisal_raw, sella_appraisal_response_text, sella_appraisal_parsed, sella_appraisal_notes = request_qwen_tool(
@ -655,13 +803,8 @@ def main() -> int:
args.think,
args.request_timeout,
)
sella_appraisal_parsed = {"appraisal": sella_appraisal_parsed} if isinstance(sella_appraisal_parsed, dict) else sella_appraisal_parsed
if isinstance(sella_appraisal_parsed, dict) and isinstance(sella_appraisal_parsed.get("appraisal"), dict):
sella_appraisal_parsed["appraisal"], nested_repair_notes = repair_nested_list_fields(
sella_appraisal_parsed["appraisal"],
["belief_updates", "response_constraints"],
)
sella_appraisal_notes.extend(nested_repair_notes)
sella_appraisal_parsed, appraisal_repair_notes = normalize_appraisal_payload(sella_appraisal_parsed)
sella_appraisal_notes.extend(appraisal_repair_notes)
sella_appraisal_notes.extend(validate_appraisal_payload(sella_appraisal_parsed))
appraisal = sella_appraisal_parsed.get("appraisal") if isinstance(sella_appraisal_parsed, dict) else None
@ -680,7 +823,8 @@ def main() -> int:
)
sella_notes.extend(validate_response_payload(sella_parsed))
all_notes = maer_notes + sella_appraisal_notes + sella_notes
repair_note_list = repair_notes(maer_notes + sella_appraisal_notes + sella_notes)
all_notes = fatal_notes(maer_notes + sella_appraisal_notes + sella_notes)
capture = {
"schema_version": "ghostlight.qwen_ink_sequential_capture.v0",
"capture_id": args.capture_id,
@ -728,32 +872,32 @@ def main() -> int:
"Sella prompt received observable Maer event and reviewed Sella state changes, not Maer's private intent.",
],
"failure_notes": all_notes,
"repair_notes": repair_note_list,
"accepted_into_ink_ref": None,
"pipeline_lessons": [
"Sequential generation needs event appraisal/consolidation before next actor selection.",
"Action type selection should be tool-shaped or schema-constrained, not left to prose compliance.",
"Character-local prompts should consume projected operating context, not raw canonical state variables.",
"Next-action prompts should receive appraisal context as prose constraints, not raw numeric state deltas.",
"Next pass should materialize the sequential capture into Ink and mutation training data.",
],
},
}
args.out_dir.mkdir(parents=True, exist_ok=True)
base = args.capture_id.replace(".", "-")
capture_path = args.out_dir / f"{base}.capture.json"
maer_prompt_path = args.out_dir / f"{base}.maer.prompt.md"
maer_response_path = args.out_dir / f"{base}.maer.response.md"
sella_appraisal_prompt_path = args.out_dir / f"{base}.sella-appraisal.prompt.md"
sella_appraisal_response_path = args.out_dir / f"{base}.sella-appraisal.response.md"
sella_prompt_path = args.out_dir / f"{base}.sella.prompt.md"
sella_response_path = args.out_dir / f"{base}.sella.response.md"
write_json(capture_path, capture)
write_text(maer_prompt_path, maer_prompt + "\n")
write_text(maer_response_path, maer_response_text + "\n")
write_text(sella_appraisal_prompt_path, sella_appraisal_prompt + "\n")
write_text(sella_appraisal_response_path, sella_appraisal_response_text + "\n")
write_text(sella_prompt_path, sella_prompt + "\n")
write_text(sella_response_path, sella_response_text + "\n")
capture_path = write_sequential_artifacts(
args,
capture,
{
"maer": maer_prompt,
"sella-appraisal": sella_appraisal_prompt,
"sella": sella_prompt,
},
{
"maer": maer_response_text,
"sella-appraisal": sella_appraisal_response_text,
"sella": sella_response_text,
},
)
print(f"wrote {capture_path.relative_to(ROOT)}")
print(json.dumps({"selected_observable_action": selected_choice, "sella_appraisal": sella_appraisal_parsed, "sella_response": sella_parsed}, indent=2, ensure_ascii=False))
return 0