#338 Wire DialogueCooldownTracker — no line repeats within 600-tick cooldown window
Also fixes a latent schedule ambiguity: emit_observation_events now has explicit .before(advance_tick) constraint.
Test plan
857/857 tests pass (cargo test --all)
Trust-gated gossip: integration test confirms Secret-tier access with KnowsDetails, Surface-only with Suspects
Line variety: regression test confirms no line_id repeats across 10 consecutive Talks within cooldown window
DialogueResponse: integration test confirms follow-up selection, conversation end on pool exhaustion, no-profile graceful noop
Serialization: DialogueResponse roundtrip test added
Golden test check after copy #542 merges (line ID rename may require fixture update)
## Summary
Sprint 16 server deliverables — dialogue becomes a two-way exchange:
- **#538** Move dialogue system registrations from BridgePlugin to NpcPlugin (game logic in the right module)
- **#539** Implement `process_dialogue_response` — full D-028 four-layer pipeline for follow-up lines when player picks a dialogue option
- **#171** Verify trust-gated gossip pipeline (D-075): Friendly+KnowsDetails unlocks Secret tier, Suspects stays Surface-only
- **#338** Wire DialogueCooldownTracker — no line repeats within 600-tick cooldown window
Also fixes a latent schedule ambiguity: `emit_observation_events` now has explicit `.before(advance_tick)` constraint.
## Test plan
- [x] 857/857 tests pass (cargo test --all)
- [x] Trust-gated gossip: integration test confirms Secret-tier access with KnowsDetails, Surface-only with Suspects
- [x] Line variety: regression test confirms no line_id repeats across 10 consecutive Talks within cooldown window
- [x] DialogueResponse: integration test confirms follow-up selection, conversation end on pool exhaustion, no-profile graceful noop
- [x] Serialization: DialogueResponse roundtrip test added
- [ ] Golden test check after copy #542 merges (line ID rename may require fixture update)
Move dialogue system registrations from BridgePlugin to NpcPlugin (#538):
game logic that depends on NPC-layer resources now registers where it
belongs. BridgePlugin retains only wire protocol concerns.
Implement DialogueResponse verb handler (#539): new process_dialogue_response
system runs the full D-028 four-layer pipeline to select follow-up lines
when the player picks a dialogue option. Clears ActiveDialogue when no
candidates remain. Fix latent schedule ambiguity — emit_observation_events
now has explicit .before(advance_tick) constraint.
Verify trust-gated gossip pipeline (#171): confirmed process_talk_interaction
correctly passes KnowledgeConfidence through relationship_to_trust() per
D-075. Added integration tests for Secret-tier access (Friendly+KnowsDetails)
and Surface-only fallback (Friendly+Suspects).
Wire DialogueCooldownTracker into selection (#338): added regression test
confirming no line_id repeats within the 600-tick cooldown window across
10 consecutive Talk interactions.
Closes#538, #539, #171, #338
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Tyre #1: Extract run_dialogue_pipeline() shared helper — eliminates ~60
lines of duplication between process_talk_interaction and
process_dialogue_response (L1-L4 pipeline).
Hoshe #1: process_dialogue_response now updates ActiveDialogue with
current tick on follow-up selection — prevents stale started_tick.
Tyre #4: process_dialogue_response now updates InteractionMemory on
follow-up — multi-turn conversations are visible in history.
Hoshe #6 / Tyre #6: handle_dialogue_response adds server-side range
check (CLOSE_RANGE), matching Talk/Confront pattern (D-010 info
boundary).
Hoshe #2: Weighted selection fallback replaced with unreachable!() —
score_line always returns >= 1, so the fallback was dead code.
Hoshe #3: assert!(false, ...) → panic!() in serialization.rs (clippy).
Hoshe #4: SetFacing and TeleportToHub added to roundtrip test.
Hoshe #5: setup_dialogue_response_world inlined (trivial pass-through).
Tyre #2: Doc comment on DialogueCooldownTracker explains per-player-global
design choice (line IDs are NPC-scoped per D-035, no collision risk).
Tyre #3: CONFRONTATION_LINES comment updated with TODO for D-028/D-035
migration.
Tyre #5: DialogueResponse fixture added for cross-language GDScript
testing (input_dialogue_response.msgpack).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Summary
Sprint 16 server deliverables — dialogue becomes a two-way exchange:
process_dialogue_response— full D-028 four-layer pipeline for follow-up lines when player picks a dialogue optionAlso fixes a latent schedule ambiguity:
emit_observation_eventsnow has explicit.before(advance_tick)constraint.Test plan
PR Review: server -> main (code)
Hoshe (Code Quality): REQUEST_CHANGES
process_dialogue_responsenever clears/updatesActiveDialogueon follow-up — stalestarted_tickpersistsscore_lineever returns 0assert!(false, ...)should bepanic!()— triggers clippy lintSetFacingandTeleportToHubmissing from roundtrip testsetup_dialogue_response_worldis trivial pass-through with unusedmuthandle_dialogue_responsehas no range check (intentional but undocumented)Tyre (Architecture): REQUEST_CHANGES
process_talk_interactionandprocess_dialogue_response— extract sharedrun_dialogue_pipelinehelperDialogueCooldownTrackeris per-player-global, not per-NPC — role-pool line IDs will collide across NPCsCONFRONTATION_LINESbypasses D-028/D-035 content pipelineprocess_dialogue_responsedoesn't updateInteractionMemory— multi-turn convos invisible to historyDialogueResponsefixture for cross-language GDScript testingDialogueResponse(D-010 info boundary gap)Verdict: CHANGES REQUESTED (6 warnings across both reviewers)
Pull request closed