Browse Source

Remove docs and tests folders

Merged PRs added docs/, tests/ and Sunrise/docs/. The shipping tree holds
only the shipping code. Test projects and notes live in prod_client_tooling.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NtVtZVmz4mDebGdZLaJRUA
stan 3 ngày trước cách đây
mục cha
commit
958eed0aba

+ 0 - 152
Sunrise/docs/emote-unlocks.md

@@ -1,152 +0,0 @@
-# Emote ownership flags
-
-How this build decides an emote is owned, how the flags behind that were
-recovered, and the data itself. None of this is public: the Bungie manifest
-exposes only the failure message for these rules, never the expression behind
-it, so everything here was read out of the installed packages directly.
-
-## Where ownership actually lives
-
-**An emote's ownership is gated by its own item definition, not by a
-collectible.** Each emote item carries a plug rule -- the one whose failure
-message is *"You do not own this emote"* -- and that rule's unlock expression
-sits at **item-definition offset 720**. The enabled rule repeats the same
-expression at offset 800.
-
-The collectible table's acquired expression (`+112`) is a dead end for emotes:
-only 94 of this build's 307 emote items have a collectible row at all, so a
-collectible-driven pass cannot reach the other 213 no matter how it is written.
-
-Decoding offset 720 for every item in the individual-emote bucket (**41**)
-gives:
-
-| | count |
-| --- | ---: |
-| emote items in this build | 307 |
-| gated by an ownership flag | 291 |
-| distinct flag slots behind them | 288 |
-| carrying no expression at all | 16 |
-
-The 16 ungated ones are always owned -- that is why Yes, Nope and Cheer worked
-before any of this.
-
-## Slots are not indices
-
-This is the part that silently wastes a day.
-
-`state.unlocks.account_flag_runs` in `default_settings.json` does **not** hold
-flag slot numbers. It fills the account object's acquired-flag byte array, and
-the client addresses that array **by row number in the unlock flag mapping
-table**, not by slot. The two are unrelated number spaces.
-
-The mapping table for this bank:
-
-| | |
-| --- | --- |
-| investment root slot | 111 |
-| tag | `81319322` |
-| rows | 11923 |
-| row shape | `{ u32 unlock_hash; i16 destination_slot; u16 zero; }` |
-
-To set flag slot `s`, find the row whose `destination_slot == s`; that row's
-**number** is the index to write. Writing `s` itself sets an unrelated flag.
-
-Symptoms of getting this wrong, both observed here:
-
-- Writing slot numbers as indices does nothing visible, because the indices
-  that happen to be hit belong to unrelated slots.
-- Filling the whole bank "works" for emotes but also sets every entitlement
-  flag, which leaves the account unable to open the Director, the map, or
-  orbit. Do not blanket fill.
-
-Translating the 288 slots through the table yields **282 row indices**. The 6
-that do not resolve have no row in this table (they are reachable only through
-the family-5 override list, which is capped at 127 rows and so is not a route
-for a set this size).
-
-## The data
-
-Ownership flag **slots** (288) -- what the item definitions name:
-
-```
-229, 237-239, 264, 271, 2218, 2222, 2232-2238, 2240, 2242-2259, 3813-3820,
-3822-3836, 5200-5205, 5209-5220, 5228-5231, 5426-5427, 5429-5436, 6245-6264,
-6896-6902, 7350-7371, 7373-7374, 8159-8165, 8167-8182, 8999-9010, 9012-9013,
-9016-9021, 10408-10428, 10907-10932, 11431-11457, 11740-11770
-```
-
-Mapping-table **row indices** (282) -- what `account_flag_runs` must contain:
-
-```
-807, 811, 821-827, 829, 831-848, 2090-2097, 2099-2113, 3080-3085, 3089-3100,
-3107-3110, 3217-3218, 3220-3227, 3729-3748, 4195-4201, 4428-4449, 4451-4452,
-5057-5063, 5065-5080, 5676-5687, 5689-5690, 5693-5698, 6353-6373, 6734-6759,
-7148-7174, 7404-7434
-```
-
-161 of those indices were already set by the authored data, which is the 179
-emotes that were already owned (161 gated + 16 ungated + 2 sharing a flag).
-The change added the remaining 121.
-
-None of the 288 slots collides with any documented entitlement, platform, or
-pre-release slot. The Director, map and orbit were verified working afterwards.
-
-## Ownership is not always the only gate
-
-An emote can carry more than one plug rule. The ownership rule at offset 720 is
-the common case, but a few items add a second rule immediately after it, and
-that one is a **value** comparison rather than a flag read. Such an emote reads
-as owned and still refuses to equip, showing *"Access Restricted"*.
-
-`X Marks The Spot` (`0x1682F6A3`) is the worked example in this build:
-
-| offset | expression | meaning |
-| ---: | --- | --- |
-| 720 | `FLAG(9004)` | ownership, set by `account_flag_runs` |
-| 736 | `VAL(5549) CONST(50) >=` | `VAL(5549) >= 50` |
-| 864 | `FLAG(9004)` | the enabled rule, pushed down by the extra rule |
-
-`VAL(5549)` is the objective progress counter for the *Golden Offerings*
-triumph, so the real requirement is completing that triumph. Value slots are
-not part of the flag banks; the route to them is the family-5 override list:
-
-```json
-"family5_value_overrides": [ ..., [5549,50] ]
-```
-
-Setting it to the threshold exactly, rather than inflating it, keeps any other
-expression that compares the same slot honest -- raising a value slot too far
-is what breaks unrelated content, per the shared-pool warning in the unlock
-documentation.
-
-Note this also shifts the layout: an emote with the extra rule has its enabled
-rule at 864 rather than 800. 32 of the 307 emotes in this build do not have a
-plain single-flag expression at 800 for this reason, which is expected and not
-a fault.
-
-## Regenerating this
-
-The flag list is specific to this build; a content change invalidates it. To
-rebuild it, three temporary passes over the package data are needed:
-
-1. For every item with `bucketId == 41`, decode the unlock expression at
-   definition offset 720. A single `opcode 1` instruction carries the flag slot
-   as its operand. Expressions resolve as
-   `target = (offset of the pointer field) + (value stored there) + 16`, the
-   same self-relative form plus 16-byte block header that `find_array_at` uses.
-2. Read the mapping table at investment root slot 111 and build
-   `destination_slot -> row index`.
-3. Run-length-encode the union of the existing runs and the new indices.
-
-Watch the cache while doing this. `stale_format()` treats only
-`version < kCacheFormatVersion` as rebuildable, so a `build_data.bin` written
-by a *newer* format version is rejected outright rather than regenerated, which
-fails state initialisation and surfaces in the client as
-*"Verify integrity of game files"*. If the cache format version is changed and
-then reverted, delete `build_data.bin`.
-
-## Known gap
-
-These flags are recorded as a set. Which flag belongs to which *named* emote
-was never captured -- the extraction logged slots without their item hashes. It
-matters only if emotes ever need unlocking selectively rather than all at once.

+ 0 - 36
docs/lore-visibility.md

@@ -1,36 +0,0 @@
-# Fresh-state lore visibility repair
-
-The earlier earned-objective repair did not satisfy the fresh-state requirement. It and
-the Confessions Family-5 override have been removed. Account projection, settings, and
-claim persistence now remain unchanged from the confirmed title-fix commit.
-
-Read-only inspection on 2026-09-04 confirmed these expressions in the running Arrivals
-client, not merely the manifest. Nodes and records both carry their identity hash at +40.
-
-| Target | Row/field | Original condition | Change |
-| --- | --- | --- | --- |
-| Eva's Journey | node 820, +64 | NOT VALUE(10343) | Replace read with constant 1; NOT true is false. |
-| The Chronicon | node 837, +64 | 15 chapter-value comparisons with zero, ANDed together | Replace the first read with constant 1; the first comparison is false, so the conjunction is false regardless of progress. |
-| Wall of Wishes | records 825–839, +120 | constant true | constant false |
-| Confessions parent | record 1707, +136 | NOT FLAG(8702) | Replace read with constant 1. |
-| Confessions chapters | records 1708–1716, +120 and +136 | NOT FLAG(8702); constant true | Replace read with constant 1; replace true with false. |
-
-There are 36 edited instructions. All other instructions and all array descriptors remain
-unchanged. This avoids relocation or allocation of expression storage. Completion flags,
-objectives, reward data, and claims are not edited. Revealing a card does not earn it.
-
-Native tables: records `0x81319339` (2242 rows × 216 bytes), nodes `0x8131933F`
-(924 rows × 168 bytes). Preflight checks exact target hashes, complete expression shapes,
-array headers and bounds. It also walks both tables' presentation-condition descriptors
-to require each edited instruction to have exactly one owner; shared constants are refused.
-No writes occur until the whole preflight succeeds. Writes are checked and rolled back on
-failure. Original instructions are retained for hook teardown.
-
-The patch runs synchronously at the existing native content-table-patching-complete event,
-before returning to investment initialization. It does not poll, scan process memory,
-or change the working socket implementation. Expected success log:
-`ev=lore_visibility result=applied conditions=36 progress_unchanged=1`.
-
-Portable tests validate every shipped expression shape, reject malformed/already-edited
-expressions, and evaluate the patched conditions with zero, partial, and completed reads.
-These tests do not substitute for confirming the UI after relaunch.

+ 0 - 35
tests/CMakeLists.txt

@@ -1,35 +0,0 @@
-cmake_minimum_required(VERSION 3.20)
-project(SunrisePortableTests LANGUAGES CXX)
-enable_testing()
-add_executable(socket_row_relocation_test socket_row_relocation_test.cpp)
-target_compile_features(socket_row_relocation_test PRIVATE cxx_std_20)
-if(MSVC)
-    target_compile_options(socket_row_relocation_test PRIVATE /W4 /WX /UNDEBUG)
-else()
-    target_compile_options(socket_row_relocation_test PRIVATE -Wall -Wextra -Werror -UNDEBUG)
-endif()
-add_test(NAME socket_row_relocation
-    COMMAND socket_row_relocation_test "${CMAKE_CURRENT_SOURCE_DIR}/fixtures/socket_rows.hex")
-add_executable(lore_visibility_test lore_visibility_test.cpp)
-target_compile_features(lore_visibility_test PRIVATE cxx_std_20)
-if(MSVC)
-    target_compile_options(lore_visibility_test PRIVATE /W4 /WX /UNDEBUG)
-else()
-    target_compile_options(lore_visibility_test PRIVATE -Wall -Wextra -Werror -UNDEBUG)
-endif()
-add_test(NAME lore_visibility COMMAND lore_visibility_test)
-
-set(SRC "${CMAKE_CURRENT_SOURCE_DIR}/../Sunrise/src")
-add_executable(map_generator_auth_test map_generator_auth_test.cpp
-    "${SRC}/middleware/bap/activity_message/activity_sensor_auth_bodies.cpp"
-    "${SRC}/middleware/bap/activity_message/activity_sensor_auth_blocks.cpp"
-    "${SRC}/middleware/encoding/bit_reader.cpp"
-    "${SRC}/middleware/encoding/bit_writer.cpp")
-target_include_directories(map_generator_auth_test PRIVATE "${SRC}")
-target_compile_features(map_generator_auth_test PRIVATE cxx_std_20)
-if(MSVC)
-    target_compile_options(map_generator_auth_test PRIVATE /W4 /WX /UNDEBUG)
-else()
-    target_compile_options(map_generator_auth_test PRIVATE -Wall -Wextra -Werror -UNDEBUG)
-endif()
-add_test(NAME map_generator_auth COMMAND map_generator_auth_test)

+ 0 - 23
tests/README.md

@@ -1,23 +0,0 @@
-# Portable regressions
-
-Run without Wine or the game:
-
-```sh
-cmake -S tests -B /tmp/sunrise-portable-tests
-cmake --build /tmp/sunrise-portable-tests
-ctest --test-dir /tmp/sunrise-portable-tests --output-on-failure
-```
-
-The fixture contains 71 original general/leg member rows and 57 opaque condition records captured
-from the Arrivals build on 2026-09-04, before relocation. Each 64-byte record contains the 32-byte
-member followed by its 32-byte condition allocation (zero for an empty condition). The first 19
-members are general; the remaining 52 are legs. Original relative offsets are deliberately retained
-so the test detects the shallow-copy bug. There are no account records or absolute process addresses.
-
-The test uses the production relocation header. It checks membership/order, payload preservation,
-relocation to another allocation, and rejection of bad pointers, substituted conditions, duplicates,
-unexpected shapes, insufficient storage, and misalignment. Assertions remain enabled in Release.
-
-`lore_visibility_test` checks all 36 targeted native expression shapes, rejects changed or
-already-patched inputs, and evaluates the repaired conditions with fresh, partial, and completed
-unlock reads. Only visibility fields are targeted. See `docs/lore-visibility.md` for the evidence.

+ 0 - 142
tests/fixtures/socket_rows.hex

@@ -1,142 +0,0 @@
-cd1f000000000000000000000000000000000000000000000000803f00000000
-0000000000000000000000000000000000000000000000000000000000000000
-ec01000000000000010000000000000040020000000000000000803f00000000
-bd9f80800100000000000000317d808000000000010000006c05000000000000
-ed01000000000000010000000000000040020000000000000000803f00000000
-bd9f80800100000000000000317d808000000000010000006d05000000000000
-ee01000000000000010000000000000040020000000000000000803f00000000
-bd9f80800100000000000000317d808000000000010000006e05000000000000
-ef01000000000000010000000000000040020000000000000000803f00000000
-bd9f80800100000000000000317d808000000000010000006f05000000000000
-f001000000000000010000000000000040020000000000000000803f00000000
-bd9f80800100000000000000317d808000000000010000007005000000000000
-ce1f000000000000010000000000000040020000000000000000803f00000000
-bd9f80800100000000000000317d808000000000010000001727000000000000
-cf1f000000000000010000000000000040020000000000000000803f00000000
-bd9f80800100000000000000317d808000000000010000001827000000000000
-d01f000000000000010000000000000040020000000000000000803f00000000
-bd9f80800100000000000000317d808000000000010000001927000000000000
-d11f000000000000010000000000000040020000000000000000803f00000000
-bd9f80800100000000000000317d808000000000010000001a27000000000000
-d21f000000000000010000000000000040020000000000000000803f00000000
-bd9f80800100000000000000317d808000000000010000001b27000000000000
-d31f000000000000010000000000000040020000000000000000803f00000000
-bd9f80800100000000000000317d808000000000010000001c27000000000000
-d41f000000000000000000000000000000000000000000000000803f00000000
-0000000000000000000000000000000000000000000000000000000000000000
-d51f000000000000000000000000000000000000000000000000803f00000000
-0000000000000000000000000000000000000000000000000000000000000000
-d61f000000000000000000000000000000000000000000000000803f00000000
-0000000000000000000000000000000000000000000000000000000000000000
-d71f000000000000000000000000000000000000000000000000803f00000000
-0000000000000000000000000000000000000000000000000000000000000000
-d81f000000000000000000000000000000000000000000000000803f00000000
-0000000000000000000000000000000000000000000000000000000000000000
-d91f000000000000000000000000000000000000000000000000803f00000000
-0000000000000000000000000000000000000000000000000000000000000000
-b02b000000000000010000000000000080010000000000000000803f00000000
-bd9f80800100000000000000317d808000000000010000008b2a000000000000
-3b20000000000000000000000000000000000000000000000000803f00000000
-0000000000000000000000000000000000000000000000000000000000000000
-f401000000000000010000000000000060060000000000000000803f00000000
-bd9f80800100000000000000317d808000000000010000007405000000000000
-b42b000000000000000000000000000000000000000000000000803f00000000
-0000000000000000000000000000000000000000000000000000000000000000
-b52b000000000000000000000000000000000000000000000000803f00000000
-0000000000000000000000000000000000000000000000000000000000000000
-b62b000000000000000000000000000000000000000000000000803f00000000
-0000000000000000000000000000000000000000000000000000000000000000
-3c20000000000000010000000000000000060000000000000000803f00000000
-bd9f80800100000000000000317d808000000000010000005227000000000000
-3d20000000000000010000000000000000060000000000000000803f00000000
-bd9f80800100000000000000317d808000000000010000005327000000000000
-3e20000000000000010000000000000000060000000000000000803f00000000
-bd9f80800100000000000000317d808000000000010000005427000000000000
-3f20000000000000010000000000000000060000000000000000803f00000000
-bd9f80800100000000000000317d808000000000010000005527000000000000
-4020000000000000010000000000000000060000000000000000803f00000000
-bd9f80800100000000000000317d808000000000010000005627000000000000
-4120000000000000010000000000000000060000000000000000803f00000000
-bd9f80800100000000000000317d808000000000010000005127000000000000
-4220000000000000010000000000000000060000000000000000803f00000000
-bd9f80800100000000000000317d808000000000010000005727000000000000
-4320000000000000010000000000000000060000000000000000803f00000000
-bd9f80800100000000000000317d808000000000010000005827000000000000
-4420000000000000010000000000000000060000000000000000803f00000000
-bd9f80800100000000000000317d808000000000010000005927000000000000
-4520000000000000010000000000000000060000000000000000803f00000000
-bd9f80800100000000000000317d808000000000010000005a27000000000000
-4620000000000000010000000000000000060000000000000000803f00000000
-bd9f80800100000000000000317d808000000000010000005b27000000000000
-4720000000000000010000000000000000060000000000000000803f00000000
-bd9f80800100000000000000317d808000000000010000005c27000000000000
-4820000000000000010000000000000000060000000000000000803f00000000
-bd9f80800100000000000000317d808000000000010000005d27000000000000
-4920000000000000010000000000000000060000000000000000803f00000000
-bd9f80800100000000000000317d808000000000010000005e27000000000000
-4a20000000000000010000000000000000060000000000000000803f00000000
-bd9f80800100000000000000317d808000000000010000005f27000000000000
-4b20000000000000010000000000000000060000000000000000803f00000000
-bd9f80800100000000000000317d808000000000010000006027000000000000
-4c20000000000000000000000000000000000000000000000000803f00000000
-0000000000000000000000000000000000000000000000000000000000000000
-4d20000000000000000000000000000000000000000000000000803f00000000
-0000000000000000000000000000000000000000000000000000000000000000
-4e20000000000000000000000000000000000000000000000000803f00000000
-0000000000000000000000000000000000000000000000000000000000000000
-4f200000000000000100000000000000a0050000000000000000803f00000000
-bd9f80800100000000000000317d808000000000010000006727000000000000
-ae2d0000000000000100000000000000a0050000000000000000803f00000000
-bd9f80800100000000000000317d808000000000010000009d2c000000000000
-50200000000000000100000000000000a0050000000000000000803f00000000
-bd9f80800100000000000000317d808000000000010000006827000000000000
-af2d0000000000000100000000000000a0050000000000000000803f00000000
-bd9f80800100000000000000317d808000000000010000009e2c000000000000
-51200000000000000100000000000000a0050000000000000000803f00000000
-bd9f80800100000000000000317d808000000000010000006927000000000000
-b02d0000000000000100000000000000a0050000000000000000803f00000000
-bd9f80800100000000000000317d808000000000010000009f2c000000000000
-52200000000000000100000000000000a0050000000000000000803f00000000
-bd9f80800100000000000000317d808000000000010000006a27000000000000
-b12d0000000000000100000000000000a0050000000000000000803f00000000
-bd9f80800100000000000000317d80800000000001000000a02c000000000000
-53200000000000000100000000000000a0050000000000000000803f00000000
-bd9f80800100000000000000317d808000000000010000006b27000000000000
-54200000000000000100000000000000a0050000000000000000803f00000000
-bd9f80800100000000000000317d808000000000010000006c27000000000000
-55200000000000000100000000000000a0050000000000000000803f00000000
-bd9f80800100000000000000317d80800000000001000000c426000000000000
-b22d0000000000000100000000000000a0050000000000000000803f00000000
-bd9f80800100000000000000317d80800000000001000000a12c000000000000
-56200000000000000100000000000000a0050000000000000000803f00000000
-bd9f80800100000000000000317d808000000000010000006d27000000000000
-b32d0000000000000100000000000000a0050000000000000000803f00000000
-bd9f80800100000000000000317d80800000000001000000a22c000000000000
-57200000000000000100000000000000a0050000000000000000803f00000000
-bd9f80800100000000000000317d808000000000010000006e27000000000000
-b42d0000000000000100000000000000a0050000000000000000803f00000000
-bd9f80800100000000000000317d80800000000001000000a32c000000000000
-58200000000000000100000000000000a0050000000000000000803f00000000
-bd9f80800100000000000000317d808000000000010000006f27000000000000
-59200000000000000100000000000000a0050000000000000000803f00000000
-bd9f80800100000000000000317d808000000000010000007027000000000000
-5a200000000000000100000000000000a0050000000000000000803f00000000
-bd9f80800100000000000000317d808000000000010000007127000000000000
-b52d0000000000000100000000000000a0050000000000000000803f00000000
-bd9f80800100000000000000317d80800000000001000000a42c000000000000
-5b200000000000000100000000000000a0050000000000000000803f00000000
-bd9f80800100000000000000317d808000000000010000007227000000000000
-5c200000000000000100000000000000a0050000000000000000803f00000000
-bd9f80800100000000000000317d808000000000010000007327000000000000
-5d200000000000000100000000000000a0050000000000000000803f00000000
-bd9f80800100000000000000317d808000000000010000007427000000000000
-b62d0000000000000100000000000000a0050000000000000000803f00000000
-bd9f80800100000000000000317d80800000000001000000a52c000000000000
-5e200000000000000100000000000000a0050000000000000000803f00000000
-bd9f80800100000000000000317d808000000000010000007527000000000000
-b72d0000000000000100000000000000a0050000000000000000803f00000000
-bd9f80800100000000000000317d80800000000001000000a62c000000000000
-5f200000000000000100000000000000a0050000000000000000803f00000000
-bd9f80800100000000000000317d808000000000010000007627000000000000
-60200000000000000100000000000000a0050000000000000000803f00000000
-bd9f80800100000000000000317d808000000000010000007727000000000000

+ 0 - 76
tests/lore_visibility_test.cpp

@@ -1,76 +0,0 @@
-#include <array>
-#include <cassert>
-#include <vector>
-
-#include "../Sunrise/src/client/hooks/network/investment/lore_visibility_patch.h"
-namespace lore = sunrise::client::hooks::network::investment::lore;
-
-// Model the decoded instructions with arbitrary unlock reads, including a completely fresh save.
-bool evaluate(std::span<const lore::Instruction> code, int value) {
-    std::vector<int> stack;
-    for (auto instruction : code) {
-        const auto op = instruction.opcode;
-        if (op == 1 || op == 10)
-            stack.push_back(value);
-        else if (op == 11)
-            stack.push_back(static_cast<int>(instruction.operand));
-        else if (op == 2) {
-            assert(!stack.empty());
-            stack.back() = !stack.back();
-        } else {
-            assert(stack.size() >= 2);
-            int b = stack.back();
-            stack.pop_back();
-            int a = stack.back();
-            stack.pop_back();
-            assert(op == 4 || op == 8);
-            stack.push_back(op == 4 ? (a && b) : (a == b));
-        }
-    }
-    assert(stack.size() == 1);
-    return stack.back() != 0;
-}
-int main() {
-    assert(lore::kTargets.size() == 36);
-    for (const auto& target : lore::kTargets) {
-        std::vector<lore::Instruction> code;
-        switch (target.shape) {
-        case lore::Shape::constant:
-            code = {{11, 1}};
-            break;
-        case lore::Shape::eva:
-            code = {{10, 10343}, {2, 0}};
-            break;
-        case lore::Shape::confessions:
-            code = {{1, 8702}, {2, 0}};
-            break;
-        case lore::Shape::chronicon:
-            for (unsigned i = 0; i < 15; ++i) {
-                code.push_back({10, 10615 + i});
-                code.push_back({11, 0});
-                code.push_back({8, UINT32_MAX});
-            }
-            for (unsigned i = 0; i < 14; ++i)
-                code.push_back({4, UINT32_MAX});
-            break;
-        }
-        const auto original = code;
-        lore::Instruction output{};
-        assert(lore::replacement(target.shape, code, output));
-        code[0] = output;
-        for (int value : {0, 1, 2, 100})
-            assert(!evaluate(code, value));
-        for (std::size_t i = 1; i < code.size(); ++i)
-            assert(code[i] == original[i]);
-        // Refuse changed schema, wrong operands, and already-modified conditions.
-        assert(!lore::replacement(target.shape, code, output));
-        code = original;
-        code.back().operand ^= 1;
-        assert(!lore::replacement(target.shape, code, output));
-        assert(!lore::replacement(target.shape, {}, output));
-    }
-    // No chapter completion, reward, or redemption fields occur in the target plan.
-    for (const auto& target : lore::kTargets) {
-        assert(target.node ? target.field == 64 : (target.field == 120 || target.field == 136));
-    }
-}

+ 0 - 78
tests/map_generator_auth_test.cpp

@@ -1,78 +0,0 @@
-#include <array>
-#include <cassert>
-#include <cstdint>
-#include <cstdio>
-
-#include "core/logging/log.h"
-#include "middleware/bap/activity_message/sensor_auth_update.h"
-#include "middleware/encoding/bit_reader.h"
-
-namespace sunrise::core::log {
-bool accepts(Channel, Level) noexcept { return false; }
-void write(Channel, Level, std::string_view) noexcept {}
-}
-
-namespace bits = sunrise::middleware::encoding::bits;
-namespace auth = sunrise::middleware::bap::activity_message::sensor_auth_update;
-
-static std::uint64_t take(bits::Reader& reader, std::uint8_t width) {
-    std::uint64_t value{};
-    assert(reader.read(width, value));
-    return value;
-}
-
-// Independent wire walk of the empty native 86657 map-generator body. The trailing
-// schemas 0x8080956C and 0x8080954D have array lengths 32 and 64, not scalar u8s.
-static void empty_generator(bits::Reader& reader) {
-    for (int side = 0; side < 2; ++side) {
-        assert(take(reader, 32) == 0);
-        assert(take(reader, 8) == 0);
-        for (int anchor = 0; anchor < 4; ++anchor) {
-            assert(take(reader, 8) == 0);
-            assert(take(reader, 8) == 0);
-            assert(take(reader, 32) == 0);
-            assert(take(reader, 1) == 0);
-        }
-        assert(take(reader, 7) == 0);
-        assert(take(reader, 1) == 0);
-        assert(take(reader, 32) == 0);
-        assert(take(reader, 32) == 0);
-        for (int field = 0; field < 5; ++field) assert(take(reader, 32) == 0);
-        assert(take(reader, 7) == 0); // Dynamic array count; no elements follow.
-    }
-    assert(take(reader, 32) == 0);
-    for (int element = 0; element < 32; ++element) assert(take(reader, 8) == 0);
-    for (int element = 0; element < 64; ++element) assert(take(reader, 8) == 0);
-}
-
-int main() {
-    std::array<std::byte, 512> output{};
-    bits::Writer writer(output);
-    auth::Snapshot snapshot{};
-    snapshot.authorWideRecordBodies = true;
-    constexpr std::uint32_t key = 0x34D23982;
-    assert(auth::write_object_block(writer, snapshot, 0x8155213E, key, 37, 81,
-                                   auth::kSlotAuthFlag | auth::kSlotSenseFlag, false, false));
-    // A following nonzero field must not be consumed as part of the generator.
-    assert(writer.write(0xA5B6C7D8, 32));
-    std::size_t written{};
-    assert(writer.finish(written));
-    bits::Reader reader(std::span(output).first(written));
-    assert(take(reader, auth::kPresenceWidth) == 1);
-    assert(take(reader, auth::kKeyWidth) == key);
-    assert(take(reader, auth::kSlotTypeWidth) == 37 + auth::kSlotTypeBias);
-    assert(take(reader, auth::kSlotIndexWidth) == 81 + auth::kSlotIndexBias);
-    assert(take(reader, auth::kKeyWidth) == 1753); // Reset, root, body, absent sense.
-    assert(take(reader, 1) == 1);
-    assert(take(reader, 1) == 1);
-    empty_generator(reader);
-    assert(take(reader, 1) == 0);
-    assert(take(reader, 32) == 0xA5B6C7D8);
-    assert(reader.remaining_bits() < 8);
-
-    // The old 998-bit buffer must be refused, rather than reported as a complete body.
-    std::array<std::byte, 125> shortOutput{};
-    bits::Writer shortWriter(shortOutput);
-    assert(!auth::write_auth_body(shortWriter, snapshot, 37, false));
-    std::puts("map generator fixed arrays and following-field alignment passed");
-}

+ 0 - 80
tests/socket_row_relocation_test.cpp

@@ -1,80 +0,0 @@
-#include <cassert>
-#include <cstdlib>
-#include <fstream>
-#include <iostream>
-#include <string>
-#include <vector>
-
-#include "../Sunrise/src/client/hooks/network/investment/socket_row_relocation.h"
-
-namespace r = sunrise::client::hooks::network::investment::relocation;
-int main(int argc, char** argv) {
-    assert(argc == 2);
-    std::array<r::Row, 71> original{};
-    std::ifstream input(argv[1], std::ios::binary);
-    std::string hex, line;
-    while (input >> line)
-        hex += line;
-    assert(hex.size() == sizeof(original) * 2);
-    auto* bytes = reinterpret_cast<unsigned char*>(original.data());
-    for (std::size_t i = 0; i < sizeof(original); ++i) {
-        bytes[i] = static_cast<unsigned char>(std::stoul(hex.substr(i * 2, 2), nullptr, 16));
-    }
-    auto target = [](const r::Row& row) {
-        auto id = r::get<std::uint32_t>(row.bytes.data());
-        return id == 492 || id == 494 || id == 495 || id == 496;
-    };
-    std::vector<r::Row> general, legs, moved;
-    for (std::size_t i = 0; i < original.size(); ++i) {
-        assert(r::valid(original[i]));
-        if (i < 19)
-            (target(original[i]) ? moved : general).push_back(original[i]);
-        else
-            legs.push_back(original[i]);
-    }
-    legs.insert(legs.begin() + 1, moved.begin(), moved.end());
-    assert(general.size() == 15 && legs.size() == 56 && moved.size() == 4);
-    assert(legs[0].bytes == original[19].bytes);
-    for (std::size_t i = 1; i < 5; ++i)
-        assert(target(legs[i]));
-    for (std::size_t i = 5; i < legs.size(); ++i) {
-        assert(legs[i].bytes == original[19 + i - 4].bytes);
-    }
-    unsigned conditions = 0;
-    for (auto& rows : {general, legs}) {
-        std::vector<std::byte> blob(r::capacity(rows.size()));
-        assert(r::build(rows, blob) && r::verify(rows, blob));
-        auto relocated = blob;
-        assert(r::verify(rows, relocated)); // actual allocation address changes
-        for (std::size_t i = 0; i < rows.size(); ++i) {
-            if (r::get<std::uint64_t>(rows[i].bytes.data() + 8) == 0) continue;
-            ++conditions;
-            auto shallow = blob;
-            std::memcpy(shallow.data() + 24 + i * 32 + 16, rows[i].bytes.data() + 16, 8);
-            assert(!r::verify(rows, shallow));
-            auto corrupt = blob;
-            auto at = 24 + i * 32;
-            auto header = at + 16 + r::get<std::int64_t>(corrupt.data() + at + 16);
-            corrupt[header + 20] ^= std::byte{1};
-            assert(!r::verify(rows, corrupt));
-        }
-        assert(!r::build(rows, std::span(blob.data(), 32)));
-        auto invalid = rows;
-        r::put(invalid[0].bytes.data() + 8, std::uint64_t{2});
-        assert(!r::build(invalid, blob));
-        invalid = rows;
-        invalid[1] = invalid[0];
-        assert(!r::build(invalid, blob));
-        assert(!r::verify(rows, std::span<const std::byte>(blob.data() + 1, blob.size() - 1)));
-    }
-    assert(conditions == 57);
-    // Regression: substituting Enhanced's condition must fail comparison to target originals.
-    auto wrong = legs;
-    for (std::size_t i = 1; i < 5; ++i)
-        wrong[i].condition = original[20].condition;
-    std::vector<std::byte> blob(r::capacity(56));
-    assert(r::build(wrong, blob));
-    assert(!r::verify(legs, blob));
-    std::cout << "PASS: 71 rows, 57 conditions; relocation, shallow-copy rejection, own-condition "
-                 "identity, malformed shape, duplicate, capacity and alignment checks\n";
-}