acdream/tests/AcDream.Headless.Tests
Erik bcfddc97e7 feat(CT): CT2 — Runtime character-title ownership + wire
Campaign CT slice CT2: the client now learns the character's earned
titles and current display title from the server, owns that state in
Runtime, and can send a display-title change. No UI (CT3/CT4).

Wire (Core.Net):
- GameEvents.ParseCharacterTitleTable (0x0029 CharacterTitle): retail
  CharacterTitleTable::UnPack @0x005c6e90 skips a leading u32 into no
  field — its own Pack @0x005c6e40 always writes the literal 1 there,
  matching ACE's unconditional Writer.Write(1u) — then reads
  displayTitleId, then a count-prefixed PList<uint> of earned ids.
- GameEvents.ParseUpdateTitle (0x002B UpdateTitle): titleId +
  setAsDisplay, per CM_Social::DispatchUI_AddOrSetCharacterTitle
  @0x006a54c0 -> Handle_Social__AddOrSetCharacterTitle @0x00564260,
  which ALWAYS adds (SendNotice_AddCharacterTitle, unconditional) and
  additionally sets display only when setAsDisplay != 0
  (SendNotice_SetDisplayCharacterTitle, gated).
- SocialActions.BuildTitleSet / WorldSession.SendSetTitle: outbound
  TitleSet (0x002C), u32 titleId, matching ACE's GameActionSetTitle.
- GameEventWiring gains onCharacterTitleTable/onUpdateTitle delegate
  holes (Core.Net cannot reference AcDream.Runtime directly).

Runtime:
- New RuntimeCharacterTitleState (RuntimeCharacterState.Titles): earned
  title id set + display title id, TableReplaced/TitleAdded/
  DisplayTitleChanged events matching retail's unconditional-add /
  gated-display-set contract, clears at generation reset.
  RuntimeCharacterOwnershipSnapshot/CaptureOwnership/IsConverged and
  RuntimeCharacterSnapshot extended (trailing optional fields, no
  existing call site broken).
- IRuntimeCharacterCommands.SetTitle: generation-gated, sends
  TitleSet only — NO optimistic local mutation. Verified against
  retail's own CM_Social::Event_SetDisplayCharacterTitle @0x006a5720,
  which sends the wire message and touches no local field; the display
  title updates only from the server's own echo (the CA-campaign
  lesson: never re-add an optimistic write). Implemented on both hosts
  (DirectGameRuntimeCommandAdapter direct-send;
  CurrentGameRuntimeCommandAdapter via LiveCommandBus /
  LiveSessionCommandRouter's new SetTitleRuntimeCmd).
- LiveSessionEventRouter wires the two inbound events unconditionally
  (RuntimeCharacterState.Titles is a required child, not an optional
  sibling like Fellowship/Allegiance).

App (non-UI plumbing + resolver):
- CharacterTitleResolver (src/AcDream.App/UI/Layout/): ports
  CharacterTitleTable::GetCharacterTitleFromID @0x005c6ed0 — titleId ->
  EnumMapper(0x22000041) canonical key -> compute_str_hash ->
  StringTable(0x2300000E) localized text. Runtime stays id-only; CT3/
  CT4 consume this for display. DIDs hardcoded per the RetailKeyNames
  precedent (CT1 verified them end-to-end).

Register: no new row. Retail's send path is non-optimistic and so is
ours — no deviation to record for this slice.

Tests: wire conformance (byte-exact + truncation) in
CharacterTitleEventsTests.cs + SocialActionsTests.cs; Runtime owner
unit tests in RuntimeCharacterTitleStateTests.cs plus integration in
RuntimeCharacterStateTests.cs; a no-local-mutation command test in
DirectGameRuntimeCommandAdapterTests.cs; an InstalledDat pin
(CharacterTitleResolverLiveDatTests.cs, ids 0/1/2/3/5/13/14, run green
with ACDREAM_RUN_INSTALLED_DAT_TESTS=1). Full solution build green;
hermetic filtered suite green (15,380 passed / 0 failed).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-24 22:03:22 +02:00
..
AcDream.Headless.Tests.csproj build: make release restore reproducible 2026-08-18 10:29:00 +02:00
HeadlessBotPolicyTests.cs test: Campaign LA finish LA2 probe and idle gates 2026-08-14 16:49:51 +02:00
HeadlessCharacterOptionsSeederTests.cs feat(CT): CT2 — Runtime character-title ownership + wire 2026-08-24 22:03:22 +02:00
HeadlessCharacterOptionsSeederWiringTests.cs feat(headless): Campaign OP slice OP7 — declared characterOptions with seed-diff sends 2026-08-11 02:45:08 +02:00
HeadlessCollisionNeighborhoodServiceWindowTests.cs feat(physics): C4 route 4b-1 — remote placement infrastructure (dormant) 2026-08-04 04:08:19 +02:00
HeadlessConfigurationLoaderTests.cs fix(launcher): Campaign LA close LA2 review findings 2026-08-14 17:20:02 +02:00
HeadlessCredentialResolverTests.cs test: make prerequisite lanes fail honestly 2026-08-18 12:09:41 +02:00
HeadlessDependencyBoundaryTests.cs feat(headless): establish portable Linux host boundary 2026-07-27 01:10:45 +02:00
HeadlessEntryPointTests.cs wip: Campaign LA LA2 probe mode + idle policy — INCOMPLETE, stopped mid-task 2026-08-14 16:33:00 +02:00
HeadlessPathSetTests.cs feat(headless): complete portable single-session host 2026-07-27 07:36:53 +02:00
HeadlessPluginSessionTests.cs feat(render): implement Campaign AR and terrain fidelity 2026-08-22 13:13:29 +02:00
HeadlessProcessContentOwnerTests.cs test(headless): enforce 30-root K4 endurance 2026-07-27 11:02:44 +02:00
HeadlessProcessResourceEnvelopeTests.cs test: replace campaign labels with behavior names 2026-08-18 12:25:00 +02:00
HeadlessProcessSchedulerTests.cs fix(headless): #368 — one dedicated update thread owns the session lifecycle; the scheduler loop no longer migrates across Task.Delay resumptions 2026-08-10 18:21:35 +02:00
HeadlessSessionEventRouteRetryPendingTests.cs docs: Campaign LA — pinned launch-contract schema COMMITTED into plan LA1 2026-08-14 16:04:32 +02:00
HeadlessSessionHostTests.cs fix(app,headless): Campaign CC slice CC4 re-review round — R1 arbiter + R2-R4 2026-08-15 19:04:04 +02:00
HeadlessSessionIsolationTests.cs fix(runtime): give the no-window host a post-merge canonical cell commit (D1, AD-60/AD-64, AP-146/#320) 2026-08-05 22:36:31 +02:00
HeadlessStaticStateAuditTests.cs fix(chat): consolidated-review fixes — retail /help Detail extraction, seam wiring test 2026-08-10 16:22:36 +02:00
LauncherHeadlessCommandLineContractTests.cs fix(tests): the launcher/headless command-line contract needs executable stubs on Linux 2026-08-19 21:53:19 +02:00
packages.neutral.lock.json build: make release restore reproducible 2026-08-18 10:29:00 +02:00
SessionConfigurationSharedFixtureTests.cs fix(plugins): close LA5 host lifecycle review 2026-08-14 19:05:13 +02:00