Commit Graph

897 Commits

Author SHA1 Message Date
gamer147
4e49a1236d cull(engine-cleanup): pass-8 phase-2 cascade round 3 after GachaUI stub 2026-07-03 22:27:45 -04:00
gamer147
78971adc46 cull(engine-cleanup): pass-8 phase-2 cascade round 2 after GachaUI stub 2026-07-03 22:26:45 -04:00
gamer147
e3b8b8dc0c cull(engine-cleanup): pass-8 phase-2 cascade round 1 after GachaUI stub 2026-07-03 22:25:44 -04:00
gamer147
a0533bf2e3 cull(engine-cleanup): pass-8 phase-2 — stub GachaUI to live surface 2026-07-03 22:24:38 -04:00
gamer147
59de7a8b86 cull(engine-cleanup): pass-8 phase-2 cascade round 5 after AreaSelectUI stub 2026-07-03 22:22:31 -04:00
gamer147
80abda90bf cull(engine-cleanup): pass-8 phase-2 cascade round 4 after AreaSelectUI stub 2026-07-03 22:21:26 -04:00
gamer147
9d4d5ff1ec cull(engine-cleanup): pass-8 phase-2 cascade round 3 after AreaSelectUI stub 2026-07-03 22:20:18 -04:00
gamer147
b148eb2968 cull(engine-cleanup): pass-8 phase-2 cascade round 2 after AreaSelectUI stub 2026-07-03 22:19:20 -04:00
gamer147
ad525456be cull(engine-cleanup): pass-8 phase-2 cascade round 1 after AreaSelectUI stub 2026-07-03 22:18:12 -04:00
gamer147
7aabb6a405 cull(engine-cleanup): pass-8 phase-2 — stub AreaSelectUI to live surface 2026-07-03 22:17:04 -04:00
gamer147
41ddba8fda cull(engine-cleanup): pass-8 phase-2 cascade round 7 after MyPageItemHome stub 2026-07-03 22:05:22 -04:00
gamer147
7938c6198c cull(engine-cleanup): pass-8 phase-2 cascade round 6 after MyPageItemHome stub 2026-07-03 22:04:24 -04:00
gamer147
4aa0ccaea7 cull(engine-cleanup): pass-8 phase-2 cascade round 5 after MyPageItemHome stub 2026-07-03 22:03:27 -04:00
gamer147
e07cacc55e cull(engine-cleanup): pass-8 phase-2 cascade round 4 after MyPageItemHome stub 2026-07-03 22:02:30 -04:00
gamer147
17b436d33d cull(engine-cleanup): pass-8 phase-2 cascade round 3 after MyPageItemHome stub 2026-07-03 22:01:31 -04:00
gamer147
e9b112d083 cull(engine-cleanup): pass-8 phase-2 cascade round 2 after MyPageItemHome stub 2026-07-03 22:00:30 -04:00
gamer147
6cf95bcfd6 cull(engine-cleanup): pass-8 phase-2 cascade round 1 after MyPageItemHome stub 2026-07-03 21:59:29 -04:00
gamer147
d89e7d9634 cull(engine-cleanup): pass-8 phase-2 — stub MyPageItemHome to live surface 2026-07-03 21:58:31 -04:00
gamer147
57312b64be cull(engine-cleanup): pass-8 phase-2 cascade round 7 after MyPageItemBattle stub 2026-07-03 21:56:59 -04:00
gamer147
200b865728 cull(engine-cleanup): pass-8 phase-2 cascade round 6 after MyPageItemBattle stub 2026-07-03 21:55:58 -04:00
gamer147
b404ff40c0 cull(engine-cleanup): pass-8 phase-2 cascade round 5 after MyPageItemBattle stub 2026-07-03 21:54:57 -04:00
gamer147
8e7fc8b15a cull(engine-cleanup): pass-8 phase-2 cascade round 4 after MyPageItemBattle stub 2026-07-03 21:54:00 -04:00
gamer147
d1f56e6dda cull(engine-cleanup): pass-8 phase-2 cascade round 3 after MyPageItemBattle stub 2026-07-03 21:53:04 -04:00
gamer147
22ef593593 cull(engine-cleanup): pass-8 phase-2 cascade round 2 after MyPageItemBattle stub 2026-07-03 21:52:04 -04:00
gamer147
006a6ae7ab cull(engine-cleanup): pass-8 phase-2 cascade round 1 after MyPageItemBattle stub 2026-07-03 21:51:02 -04:00
gamer147
57dee92570 cull(engine-cleanup): pass-8 phase-2 — stub MyPageItemBattle to live surface 2026-07-03 21:49:55 -04:00
gamer147
3a652479f6 cull(engine-cleanup): pass-8 phase-2 cascade round 6
[trim] fully-unreachable files deleted: 1
[trim] files edited: 1, files deleted: 0, nodes removed: 1
[type-trim] files edited: 0, types removed: 0

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-07-03 21:23:50 -04:00
gamer147
7d1ea2b38d cull(engine-cleanup): pass-8 phase-2 cascade round 5
[trim] fully-unreachable files deleted: 1
[trim] files edited: 4, files deleted: 0, nodes removed: 6
[type-trim] files edited: 0, types removed: 0

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-07-03 21:22:48 -04:00
gamer147
8b07f6a0b2 cull(engine-cleanup): pass-8 phase-2 cascade round 4
[trim] fully-unreachable files deleted: 0
[trim] files edited: 5, files deleted: 0, nodes removed: 12
[type-trim] files edited: 0, types removed: 0

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-07-03 21:21:46 -04:00
gamer147
c88b8df409 cull(engine-cleanup): pass-8 phase-2 cascade round 3
[trim] fully-unreachable files deleted: 3
[trim] files edited: 6, files deleted: 0, nodes removed: 23
[type-trim] files edited: 0, types removed: 0

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-07-03 21:20:40 -04:00
gamer147
e3e0ba7a72 cull(engine-cleanup): pass-8 phase-2 cascade round 2
[trim] fully-unreachable files deleted: 3
[trim] files edited: 21, files deleted: 0, nodes removed: 38
[type-trim] files edited: 3, types removed: 3

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-07-03 21:19:36 -04:00
gamer147
c9628dee01 cull(engine-cleanup): pass-8 phase-2 cascade round 1
[trim] fully-unreachable files deleted: 6
[trim] files edited: 55, files deleted: 0, nodes removed: 244
[type-trim] files edited: 1, types removed: 1

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-07-03 21:18:18 -04:00
gamer147
3fb37f0249 chore(engine-cleanup): drop stale BattleAmbientContext analyzer root 2026-07-03 21:06:53 -04:00
gamer147
2d9a6eea4b engine cleanup passes 4-7 + multi-instancing ambient rip
Squashes 146 commits from battle-engine-extraction. Net: 2,045 files changed,
+11,896 / -158,687 lines. Ships engine passes 4-7 (dead-code cull, view-layer
stub, receive-path shrink) plus the Phase-5 AsyncLocal ambient deletion that
turns concurrent battles into a type-system property rather than a scope
contract.

## What landed

**Passes 4-7 (chunks 1-34):** Extended the Phase-4 const-false collapse into a
cascading cull across the skill graph, view layer, and receive-path periphery.
Six mode flags (IsWatchBattle/IsReplayBattle/IsAdmin/IsAdminWatch/IsPuzzleQuest/
IsAINetwork) became `const false`, every guarded block deleted. Field*.cs
subclass ctors + BackGroundBase + ObjectChecker culled to no-ops. Mulligan
family reworked to take a mgr param through IMulliganMgr.InitMulligan.
Emotion/Recovery/Resource clusters null-stubbed. Prediction/OperationSimulator/
skill filters converted from static ambient reads to per-mgr reads via
SkillPrm.ownerCard.SelfBattlePlayer.BattleMgr / ins.BattleMgr / this.BattleMgr.

**Phase-5 ambient rip (chunks 35-47):** Deleted BattleAmbient / BattleAmbient-
Context / TestBattleScope in full. Every per-battle mutable slot now lives on
the mgr instance itself:
  mgr.InstanceIsForecast / InstanceIsRandomDraw / InstanceRecoveryInfo /
  InstanceViewerId / InstanceNetworkAgent / GameMgr
BattleManagerBase.GetIns() returns null unconditionally; the residual static
flags + 3 façades (Certification.ViewerId, Data.BattleRecoveryInfo,
ToolboxGame.RealTimeNetworkAgent) are null-tolerant defaults kept for the
handful of engine-internal readers that still reference their types. Zero
BattleAmbient references anywhere in engine + node + tests.

Added pre-seeded GameMgr ctor overload threaded through the mgr chain
(BattleManagerBase → SingleBattleMgr / NetworkBattleManagerBase → NetworkStandard-
BattleMgr → HeadlessBattleMgr / HeadlessNetworkBattleMgr). Fixtures build a
GameMgr, seed it via HeadlessEngineEnv.SeedCharaIds/SeedNetUser, and pass it
to the mgr's ctor — no ambient reach.

Node side (SVSim.BattleNode/SessionBattleEngine): _ctx replaced with a plain
GameMgr field; 34 `using var _ambient = BattleAmbient.Enter(_ctx)` scope wraps
ripped from every accessor and mutator; EngineGlobalInit.WirePerSessionGameMgr
takes GameMgr as a param and runs from SessionBattleEngine.SetupInternal
BEFORE mgr construction.

Test side: TestBattleScope deleted; 18 fixture [SetUp]s migrated to
`HeadlessEngineEnv.EnsureProcessGlobals()`; MultiInstanceEngineTests rewritten
around per-mgr construction (GetIns() → null is the pinned invariant).

## Regression fixes

- **chunk-48** (MulliganCtrl): chunk-35's `= null` stubs on card lookups broke
  the live receive-driven Deal path (BattlePlayerBase.DrawCard NRE'd downstream
  of NetworkPlayerMulliganCtrl.StartMulliganVfx). Restored the three lookups
  via `_battlePlayer.BattleMgr.GetBattleCardIdx`. Engine tests were satisfied
  by the WireMulliganPhase seam; unit tests exposed the live-path gap.

## Ship state

- SVSim.BattleEngine.Tests: 56/56 pass, 2 skip
- SVSim.UnitTests: 1554/1554 pass (was 1523/31-fail before chunk 48)
- Solution build: 0 source warnings (40 pre-existing NU1902 MessagePack CVEs
  in SVSim.EmulatedEntrypoint, unrelated)
- Sequential PVP smoke: verified live (two back-to-back battles, no regression
  on cleanup/spinup)
- Concurrent PVP smoke: verified live

Adds tools/engine-port/ClosureAnalyzer/ — the Roslyn transitive-type-closure
analyzer needed to make future cascade cleanup safe (per feedback memory
"Engine cleanup needs closure tool" from the 2026-06-28 pass-3 failure).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-07-03 19:18:54 -04:00
gamer147
5c1db83967 feat(pack): /pack/set_rotation_starter_class + selected_class_id read-back
Implements Task 9 from docs/superpowers/plans/2026-06-13-decomp-only-followups.md
— the pre-purchase commit endpoint the client fires from StarterClassSelectDialog
before opening a RotationStarterCardPack. Without this the per-class draw path
from yesterday's work is unreachable: the dialog blocks on the AJAX call and
never advances to /pack/open.

Wire surface:
- POST /pack/set_rotation_starter_class { pack_id, class_id } → EmptyData.
  Validates 1..8, rejects unknown packs (404), non-RS packs (400), and second
  commits (400 — one-shot per pack per spec).
- PackConfigDto carries selected_class_id (nullable, omitted via global
  WhenWritingNull policy when unset). Placement verified against decomp at
  PackInfoTask.cs:86 — it's on the parent PackConfig, NOT the child gacha as
  the original plan text had it.
- /pack/open cross-checks request.class_id against the persisted choice for
  RS packs; rejects 400 on missing-commit or class-mismatch so a tampered
  request can't swap pools after the choice is locked.

Storage:
- ViewerPackStarterClass owned entity; (ViewerId, PackId) unique index via the
  pattern from project_owned_collection_unique_index memory.
- Migration PackStarterClass — composite PK + FK cascade verified against
  fresh Postgres bootstrap.

Tests (9 new in PackControllerSetRotationStarterClassTests):
- Round-trip set → /pack/info shows selected_class_id.
- Field absent before any commit.
- Invalid class (0/9/-1/100) → 400.
- Already-chosen rejection.
- Non-RS pack / unknown pack rejection.
- /pack/open rejects no-prior-commit AND class-mismatch; succeeds when class
  matches the persisted choice.

Full suite: 1552 passed (1543 + 9).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-27 20:06:46 -04:00
gamer147
869727cc06 feat(pack-draw): per-class card pools for rotation-starter packs
Add a nullable ClassId axis to PackDrawCardWeightEntry. Null means the
row applies to any draw (the existing behavior for non-RS packs); 1..8
restricts the row to a specific class draw on a RotationStarterCardPack.
Slot rates are class-invariant (verified against per-klan captures), so
PackDrawSlotRateEntry is unchanged.

PackOpenService.Draw now takes an optional classId parameter. With a
class supplied, the card pool is filtered to (ClassId == classId ||
ClassId == null); without one, class-tagged rows are excluded so a
mistaken non-RS call against a mixed table can't leak class-specific
cards.

PackController.Open lifts the 501 guard on RotationStarterCardPack and
plumbs class_id through. Class_id is now required (and validated 1..8)
for RS packs and rejected as 400 BadRequest on non-RS packs. The skin
overload (target_card_id) remains 501 — out of scope for this work.

Seed JSON regenerated end-to-end: 32 RS packs now carry 30,160 class-
tagged weight rows; 247 non-RS packs keep their existing ~87k null-class
rows. Slot rate fix from the upstream extractor change replaces the
~99.99% conditional-rate sums on 97xxx/93xxx packs with the page's
authoritative 1.5/6/25/67.5 distribution.

Migration AddPackDrawCardWeightClassId. End-to-end bootstrap verified
against fresh Postgres; pack 93025 reads back exactly 122/119/120/120/
120/121/118/119 weights for classes 1-8.

Tests: 3 new PackOpenServiceTests (class filter happy path, disjoint
pools, defensive null-class isolation); existing class_id-on-non-RS
controller test updated 501 → 400 BadRequest; one stub-importer test
corrected to match extractor-authored gacha_detail.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-27 19:35:08 -04:00
gamer147
ff77d5e5b6 fix(guild): final-review remediation — replay_detail flat, FK on leader, transaction wraps, _db extraction
C1: replay_detail — flatten stored payload to data level. ChatReplayDetailTask.Parse() calls
new ReplayDetailInfo(data) which unguardedly accesses data[battleId], data[seed], data[vid1],
etc. Wrapping under replay_info key crashes the client. Controller now returns Ok(JsonElement)
directly so stored battle fields are at data root. Wire-shape test added.

C2: Guild.LeaderViewerId long to long?; add HasOne<Viewer> FK with OnDelete=SetNull; migration
AddGuildLeaderViewerIdFk; all consumers null-guarded with ?? 0L.

C3: BreakupAsync — wrap 6 destructive ops in IDbContextTransaction with InMemory fallback.

C4: CommitJoinAsync — wrap member-add + viewer-guildId-set + invite/request cleanup in
IDbContextTransaction with InMemory fallback. Chat event emitted after commit.

I1: GuildController — remove SVSimDbContext field; inject IViewerRepository + IGuildMemberRepository.
Add IGuildMemberRepository.GetViewerIdsInAGuildAsync (batch guild-membership check).
All _db.Viewers / _db.GuildMembers queries replaced with repo calls.

I2: GuildService — extract 3 _db.Viewers queries: GetEquippedEmblemIdAsync (CreateAsync),
LoadGuildProfileBatchAsync (ListOutgoingInvitesAsync + ListPendingJoinRequestsForMyGuildAsync).
Add GuildMemberProfile record with IsOfficialMarkDisplayed. GetEmblemListAsync for EmblemList.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-27 16:33:59 -04:00
gamer147
754b2ca466 fix(guild_chat): wait_interval as raw int + capture-replay request field name
Remove StringifiedIntConverter from GuildChatMessagesResponse.WaitInterval so the
wire emits a raw JSON number (3) matching prod, not a quoted string ("3").
Update GuildChatPollTests (2 assertions) and GuildCaptureReplayTests (1 assertion +
comment) to expect JsonValueKind.Number. Fix last_message_id → start_message_id typo
in GuildChatMessages_Member_ReturnsProdShape request body.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-27 15:40:30 -04:00
gamer147
6467223b52 test(guild): capture-replay against traffic_prod_guild_create.ndjson
5 integration tests in GuildCaptureReplayTests replay the prod guild/info (pre-join +
post-create), guild/search_guild, guild/emblem_list, and guild_chat/messages flows
against the in-process WebApplicationFactory server.

Assertions are limited to always-present, session-independent fields:
- guild/info pre-join: guild_status=0, max_member_num=30,
  max_sub_leader_num=2, usable_stamp_list=[100001..100020] (exact match)
- guild/info post-create: guild_status=2, guild object present
- guild/search_guild: list field is a JSON array
- guild/emblem_list: guild_emblem_list field is a JSON array
- guild_chat/messages: chat_message[] + maintenance_card_list[] arrays present,
  wait_interval > 0 (accepts either raw int or stringified form)

Bodies are AES-encrypted in the capture, so requests are re-issued as plain JSON
to the test server (same shape, different auth context). Manual end-to-end (live
Steam client + clean Postgres) deferred to operator — can't automate in this session.

1534 → 1539 tests; 0 failures.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-27 15:32:47 -04:00
gamer147
d62f1b7ba7 feat(guild): MyPage guild_notification + load_index audit
- Replace GuildNotification TODO stub in MyPageController.Index with
  BuildGuildNotificationAsync: populates guild_id, guild_room_message_id,
  is_join_request, is_invited from real DB state.
- Inject IGuildService, IGuildInviteRepository, IGuildJoinRequestRepository,
  IGuildChatMessageRepository into MyPageController.
- Add GetMaxMessageIdSafelyAsync to IGuildChatMessageRepository (returns null
  when no messages exist, vs GetMaxMessageIdAsync which returns 0).
- LoadDetail.cs audit: grep returned no guild fields — no LoadController changes.
- Add GuildCrossSurfaceTests (4 tests): guild member, pending invite, pending
  join request, no-guild viewer all verified green.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-27 15:24:46 -04:00
gamer147
eb65c2081c feat(guild_chat): deck + replay attachments
Implement all five guild_chat attachment endpoints:
- add_deck: server looks up deck by (viewerId, format, deckNo) and snapshots
  the current state into a DECK-type chat message DeckPayload column.
- delete_deck: author OR leader/sub-leader may clear; returns refreshed
  deck_log. Extended IGuildChatMessageRepository.ClearDeckAsync with
  leaderOverride flag; added GetDeckMessagesAsync + GetByMessageIdAsync.
- add_replay: stores {"battle_id": N} in ReplayPayload; full shape is
  TODO(post-merge) pending replay-subsystem capture.
- replay_detail: returns the stored ReplayPayload as JsonElement passthrough.
- deck_log: returns all active DECK messages grouped by API-side Format string
  key ("1"=Rotation, "2"=Unlimited, "3"=PreRotation always present;
  "4"=Crossover, "5"=MyRotation only when non-empty).

Adds DeckLogDataDto (typed) for deck_log / delete_deck responses.
Replay response uses JsonElement passthrough (TODO(post-merge)).
8 new integration tests — all green. Full suite 1530/1530 pass.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-27 15:14:06 -04:00
gamer147
ab1e23b7cb feat(guild_chat): post text + stamp
Implements PostTextOrStampAsync: validates membership (NotInGuild),
validates stamp id against UsableStampList (PermissionDenied), rejects
type other than 0 or 1, allocates next per-guild message_id, appends row.
Wires /guild_chat/post controller action mapping failures to result_code=2.
Response is GuildChatPostResponse (empty body per spec). 7 integration tests.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-27 14:58:18 -04:00
gamer147
a248c167e0 refactor(guild_chat): extract chat-user lookup to viewer repo; fix NEW-direction exclusivity
Add ChatUserProfile record and IViewerRepository.LoadChatProfilesAsync (AsNoTracking,
projects Name/EmblemId/CountryCode/Rank/DegreeId from Viewer+Info nav refs).
GuildChatController.Messages now injects IViewerRepository instead of SVSimDbContext;
calls LoadChatProfilesAsync to populate users[] (removes direct db access from controller).
GuildChatMessageRepository direction=2 (NEW): change >= start to > start (exclusive).
GuildChatPollTests updated to assert the start message is NOT returned by direction=NEW.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-27 14:51:44 -04:00
gamer147
358f43aa7a feat(guild_chat): messages window + system events
- GuildChatService.EmitSystemEventAsync: replaces no-op stub with real
  chat-row insertion via _msgs.AppendAsync (per-guild monotonic id).
- GuildChatService.GetWindowAsync: real implementation — verifies caller
  membership, delegates to IGuildChatMessageRepository.GetWindowAsync
  (direction 1=OLD/2=NEW/3=BOTH, limit 50), returns adaptive wait interval
  (ChatPollActiveSeconds when messages returned, ChatPollIdleSeconds otherwise).
- Drop unused repo injections from GuildChatService (guilds, invites, joinRequests).
- GuildChatController.Messages: wires the full response — chat_message[],
  users[] (deduplicated author profiles with Emblem+Degree nav includes),
  maintenance_card_list (empty until maintenance service lands), wait_interval.
- GuildChatPollTests (7 integration tests): fresh-guild CreateGuild event,
  sequenced Create+Join ordering, direction=NEW filter, direction=BOTH window,
  users[] deduplication, empty result for viewer-not-in-guild, active vs idle
  interval comparison. All 7 pass; full suite 1515/1515.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-27 14:44:09 -04:00
gamer147
484b51086a fix(guild): friend_list returns bare array-at-root (matches GuildFriendListTask.Parse)
GuildFriendListTask.Parse() reads base.ResponseData[data][i] directly —
data must be a bare JSON array, not {friends:[...]}.  Delete the
GuildFriendListResponse wrapper DTO; promote GuildInviteCandidateDto to its
own file.  Controller now returns List<GuildInviteCandidateDto> so the
middleware wraps it as data:[…].  Update wire-shape and integration tests to
assert array-at-root.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-27 14:35:20 -04:00
gamer147
f2b996a593 feat(guild): change_role atomic transfer + friend_list
- ChangeRoleAsync: Leader-only role management with SubLeader cap check.
  Atomic leader transfer loads both member rows + Guild.LeaderViewerId in
  one _db.SaveChangesAsync call (no split saves). Emits ChangeLeader (6)
  or ChangeSubLeader (7) chat events. Same-role is no-op / returns Ok.
- /guild/change_role controller: calls ChangeRoleAsync, returns full updated
  member list (GuildChangeRoleResponse.Members[]).
- /guild/friend_list controller: calls IFriendService.GetFriendsAsync, then
  annotates each friend with is_join_guild from Viewer.GuildId column.
- IGuildRepository.UpdateLeaderViewerIdAsync: added for completeness even
  though the atomic transfer path bypasses it via direct EF mutation.
- Tests: 8 GuildServiceChangeRoleTests (role changes, cap, atomic transfer,
  no-op, permission); 3 GuildChangeRoleFriendListFlowTests (HTTP roundtrip,
  is_join_guild); 2 GuildWireShape tests (literal JSON shape); 1508 pass.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-27 14:27:13 -04:00
gamer147
00fb28681b feat(guild): leave + remove with leader-leaves rule
- LeaveAsync: regular/subleader removes self; leader blocked if members remain;
  sole-member leader auto-routes to BreakupAsync.
- RemoveAsync: leader-only kick (SubLeader has no remove authority per
  GuildManager.cs decompile); self-remove and cross-guild target rejected.
- GuildController: wired /guild/leave (BaseRequest) and /guild/remove
  (GuildRemoveRequest.remove_viewer_id field).
- SpyGuildChatService: extended Emissions with EmissionsWithBody tuple to
  allow body-content assertions in leave/remove tests.
- 8 new integration tests; all 1493 pass.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-27 14:16:47 -04:00
gamer147
901c3d7568 fix(guild): subleaders can accept/reject join requests (matches GuildManager.HasAuthorityInviteAndApproval)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-27 14:06:30 -04:00
gamer147
dd955fe4be feat(guild): join_request_accept + reject_join_request 2026-06-27 13:58:54 -04:00
gamer147
771d884314 fix(guild): /guild/join returns guild_status per branch (APPLYING for approval path, JOINING otherwise)
GuildJoinTask.Parse() reads data[guild_status].ToInt() directly; hardcoding 2
for the APPROVAL path was wrong. GuildOpResult gains nullable GuildStatus; JoinAsync
sets 1 (APPLYING) for the pending-request path and 2 (JOINING) for instant joins.
Controller reads r.GuildStatus. Two new tests assert the wire value per path.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-27 13:51:04 -04:00