47b5a81b1f6014bd74627adbea85ec0195e1b6fc
- Author
- TheEdgeOfRage <git@theedgeofrage.com>
- Committer
- TheEdgeOfRage <git@theedgeofrage.com>
- Date
Message
Diff
This diff is truncated to protect this page.
1diff --git a/internal/game/orchestrator.go b/internal/game/orchestrator.go
2index 405752c36f799a6063546806629eb01be42c0b43..ed2ae60b2f1805a3844ed46a4debd6f17da3ae54 100644
3--- a/internal/game/orchestrator.go
4+++ b/internal/game/orchestrator.go
5@@ -145,7 +145,7 @@ func (o *Orchestrator) GenerateFlashcards(ctx context.Context, action string) (i
6 func (o *Orchestrator) ActionTurn(ctx context.Context, action string) TurnResult {
7 var res TurnResult
8
9- o.state.RecordUser(action)
10+ o.state.RecordTyped(action)
11 _ = o.compactOpenIfOverBudget(ctx)
12 prompt := o.state.Prompt()
13
14@@ -205,7 +205,7 @@ func (o *Orchestrator) FinishSpeak(ctx context.Context) TurnResult {
15 return res
16 }
17
18- o.state.RecordUser(raw)
19+ o.state.RecordSpoken(raw)
20 _ = o.compactOpenIfOverBudget(ctx)
21 prompt := o.state.Prompt()
22
23diff --git a/internal/game/state.go b/internal/game/state.go
24index 49950b4776caaea666591b6d468b01bee42b3986..b843cc44027e88994ea4b408d44b0fa532dda320 100644
25--- a/internal/game/state.go
26+++ b/internal/game/state.go
27@@ -95,10 +95,25 @@ func (s *State) Talk() string {
28 return s.talk
29 }
30
31-// RecordUser appends the player's next user message (typed action or spoken
32-// transcript) to the open segment. Call it before Prompt for that turn so the
33-// model sees the new move; the matching assistant reply is added by ApplyReply.
34+// RecordTyped appends one silent typed action, tagged so the model can never
35+// mistake it for speech. Call it before Prompt for that turn; the matching
36+// assistant reply is added by ApplyReply.
37+func (s *State) RecordTyped(action string) {
38+ s.appendUser("[action] " + action)
39+}
40+
41+// RecordSpoken appends one spoken line - the only player words NPCs can hear.
42+func (s *State) RecordSpoken(line string) {
43+ s.appendUser("[spoken] " + line)
44+}
45+
46+// RecordUser appends one raw, untagged user message to the open segment
47+// (internal world notes, not player input).
48 func (s *State) RecordUser(content string) {
49+ s.appendUser(content)
50+}
51+
52+func (s *State) appendUser(content string) {
53 s.open.Messages = append(s.open.Messages, Message{Role: roleUser, Content: content})
54 }
55
56diff --git a/internal/llm/prompt.go b/internal/llm/prompt.go
57index cbca54b2d9bf8d54181896b27716cfade8144fb2..c23a947e655bd3080c6fd72cfb94b49787a94e08 100644
58--- a/internal/llm/prompt.go
59+++ b/internal/llm/prompt.go
60@@ -46,9 +46,9 @@ The world, briefly:
61 Everything else - every place, person, price, and detail - is invented as the player explores, and must stay consistent with the character sheets and anything earlier in this conversation.
62
63 How to respond
64-- The player's typed English text is an instruction to you (the world). It is never speech spoken aloud; no NPC hears it. Advance the scene from it.