feat(client): id helper + leaf canon-log entities with owned invariants

Also configure GUT to not treat push_error() as a test failure
(client/.gutconfig.json: failure_error_types = [engine, gut]).
The brief's LogPlayer/Quest setters intentionally push_error() on
rejected input; GUT's default failure_error_types includes
push_error, which would fail test_player_rejects_unknown_class and
test_quest_status_enum despite their assertions passing.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-07-09 14:12:16 -05:00
parent 5486ed00fa
commit a682022f17
15 changed files with 209 additions and 1 deletions

View File

@@ -0,0 +1,24 @@
class_name Humiliation
extends RefCounted
## A Banter-memory row (charter §9). weight 1..10 drives reference frequency;
## turn drives decay. Append-only at the container level — these stack.
var id: String
var text: String
var weight: int
var turn: int
func _init(p_id := "", p_text := "", p_weight := 1, p_turn := 0) -> void:
id = p_id
text = p_text
weight = clampi(p_weight, 1, 10)
turn = maxi(p_turn, 0)
func to_dict() -> Dictionary:
return {"id": id, "text": text, "weight": weight, "turn": turn}
static func from_dict(d: Dictionary) -> Humiliation:
return Humiliation.new(d.get("id", ""), d.get("text", ""), int(d.get("weight", 1)), int(d.get("turn", 0)))