Use Qwen chat tools with thinking

This commit is contained in:
Meta Vens 2026-05-02 03:26:13 +01:00
commit 3a033f8213
24 changed files with 2322 additions and 52 deletions

View file

@ -45,6 +45,7 @@ Ghostlight now has the persistence spine plus the first architecture payload:
- Aetheria lore grounding docs:
- `docs/architecture/aetheria-lore-grounding-architecture.md`
- `docs/architecture/lore-grounding-digest-format.md`
- `docs/architecture/qwen-invocation-notes.md`
- lore grounding seam:
- `schemas/lore-grounding-digest.schema.json`
- `examples/lore-grounding/historical-flashpoint.template.json`
@ -81,7 +82,10 @@ Ghostlight now has the persistence spine plus the first architecture payload:
- sequential branch mutation seam:
- `experiments/ink/cold-wake-sanctuary-intake-qwen-sequential-v1.capture.json`
- `experiments/ink/cold-wake-sanctuary-intake-qwen-sequential-v2.capture.json`
- `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-v1.mutation.json`
- `experiments/ink/qwen-chat-tools-smoke.json`
- `examples/agent-state.cold-wake-story-lab.after-sanctuary-ledger.json`
- Cold Wake fixture note:
- `docs/architecture/aetheria-cold-wake-training-fixture.md`
@ -114,9 +118,9 @@ training feedstock for projection and dialogue scaffolding.
## Current Next Action
Replace prose-only sequential Qwen JSON generation with a stricter
tool-shaped schema or post-generation repair pass for array fields, then
materialize only a fully validated sequential branch into Ink.
Materialize the accepted v5 thinking-plus-tools sequential capture into an Ink
branch draft and sidecar, then apply reviewed state mutation only after
validation.
Cat/Oz remains useful as an Elysium procedural mechanics fixture, but grounded
training data should start from authored historical lore rather than gameplay
@ -183,13 +187,22 @@ Completed projection path items:
(`show_object` followed by Sella's `withhold_object`), but remains
useful-needs-revision because prose prompting did not force array-typed JSON
fields
- verify Qwen invocation:
`tools/check_qwen_chat_tools.py` proves local `qwen3.5:9b` returns both
`message.thinking` and native `tool_calls` through Ollama `/api/chat`
- update the sequential runner to use `/api/chat` with native tools and
`think: true` by default
- add v3 and v5 thinking-plus-tools captures:
v3 preserved a useful failure where old prompt text still caused plain JSON
content in later passes; v5 is accepted as draft and produced valid
tool-shaped Maer choice, Sella appraisal, and Sella next action
Remaining projection path:
- build a deterministic speaker-local input slicer
- build a renderer that emits projection controls before prompt prose
- replace prose-only sequential Qwen JSON generation with stricter tool-shaped
schema enforcement or an explicit post-generation repair/review pass
- materialize the accepted v5 thinking-plus-tools sequential capture into Ink
and sidecar annotation
- 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

@ -67,6 +67,9 @@ state and re-entry discipline.
- `docs/architecture/lore-grounding-digest-format.md`
- human-facing format guide for cultural, factional, institutional, role, and
speaker-boundary lore digests
- `docs/architecture/qwen-invocation-notes.md`
- verified local Qwen invocation policy: Ollama `/api/chat`, native tools,
thinking enabled, repair for known nested-argument double-stringify cases
- `docs/architecture/aetheria-cold-wake-training-fixture.md`
- human-facing note that reframes the recovered Cold Wake scenario as
historical projection feedstock rather than the active product target
@ -129,6 +132,17 @@ state and re-entry discipline.
model; it produced canonical action labels and a concrete Sella
`withhold_object` next action, but still needs stricter schema enforcement
because some array fields came back as strings or objects
- `experiments/ink/cold-wake-sanctuary-intake-qwen-sequential-v3.capture.json`
- useful-needs-revision thinking-plus-tools receipt that proved Maer could
call the tool while later passes still fell back to plain JSON content
because old prompt text conflicted with the tool path
- `experiments/ink/cold-wake-sanctuary-intake-qwen-sequential-v5.capture.json`
- accepted-as-draft thinking-plus-tools receipt using Ollama `/api/chat`,
native tools, and `think: true` for Maer choice, Sella appraisal, and Sella
next action
- `experiments/ink/qwen-chat-tools-smoke.json`
- smoke receipt proving local `qwen3.5:9b` returns both `message.thinking`
and native `tool_calls`
- `experiments/ink/cold-wake-sanctuary-intake-qwen-sequential-v1.mutation.json`
- first reviewed branch mutation receipt, including manual participant
appraisal/consolidation, normalized action labels, applied state deltas, and
@ -162,8 +176,11 @@ state and re-entry discipline.
- turns a reviewed Qwen branch capture into a playable Ink draft and sidecar
annotation
- `tools/run_qwen_ink_sequential_generation.py`
- builds a sequential Qwen prototype: actor-local choices, participant
- 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
- `tools/check_qwen_chat_tools.py`
- fast smoke test for local Qwen thinking plus native tool calling
- `tools/apply_sequential_ink_branch_mutation.py`
- applies a reviewed replay of one selected branch into a mutated agent-state
fixture and mutation receipt without letting Ink variables become
@ -190,7 +207,8 @@ story-lab Qwen captures now exist as v0 seams. The first complete Cold Wake
story pass exists with receipts, projection controls have been promoted, and
Ink is now the standard branching scene format. The 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, and v2 shows
the symmetrical turn model improves action behavior. The next implementation
target is stricter sequential capture schema enforcement before Ink
materialization.
reviewed mutation replay that updates both involved characters, v2 shows the
symmetrical turn model improves action behavior, and v5 proves local
thinking-plus-tools invocation works for the scene runner. The next
implementation target is materializing the accepted v5 capture into Ink and a
sidecar annotation.

View file

@ -105,9 +105,17 @@
action labels and a concrete Sella `withhold_object` next action, but
still needs stricter schema or tool-call enforcement because array fields
drifted into strings and objects.
- Next prototype: replace prose-only JSON compliance with a stricter
tool-shaped schema or repair/review pass before materializing the branch
into Ink.
- Qwen invocation correction: use Ollama `/api/chat` with native tools and
`think: true`, not `/api/generate` with prose-only JSON instructions.
Qwen's XML-shaped tool format belongs to the chat-template/tool-call
layer; Ghostlight artifacts do not need XML wrappers.
- Third sequential draft: v3 proved the tool path could work for Maer while
later passes still fell back to plain JSON because old prompt contract
text conflicted with tool calling.
- Fifth sequential draft: v5 is accepted as draft. It used thinking plus
native tools for Maer choice, Sella appraisal, and Sella next action.
- Next prototype: materialize the accepted v5 capture into Ink and sidecar
annotation, then apply reviewed state mutation only after validation.
5. Build the projection distillation loop. Started.
- Use `docs/architecture/projection-distillation-plan.md` as the teacher to