Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
625bc00
runtime-map-tests: link Pokemon_Direction.cpp (MapData uses direction…
dayfine Nov 12, 2026
ea9b142
Tests: nest Input and Expectation inside each native test case struct
dayfine Nov 12, 2026
5fedcce
BDSP AutoStory: stop for Starter RNG at the Verity Lakefront
dayfine Nov 12, 2026
91d6235
Review fixes: comment content, designated initializers, include place…
dayfine Nov 12, 2026
03bc3d4
BDSP: port Starter RNG from #1366 (theastrogoth)
dayfine Nov 12, 2026
c2101fe
runtime-map tests: README passes the pinned publisher revision
dayfine Nov 12, 2026
874c461
BDSP Starter RNG: make the attempt loop callable
dayfine Nov 12, 2026
1e1a9bd
Merge branch 'bdsp/starter-rng-callable' into bdsp/autostory-starter-rng
dayfine Nov 12, 2026
2102439
BDSP AutoStory: run Starter RNG in 00.02
dayfine Nov 12, 2026
651fbca
Merge remote-tracking branch 'origin/bdsp/autostory-v4' into bdsp/sta…
dayfine Nov 12, 2026
db63d7e
Merge remote-tracking branch 'origin/bdsp/autostory-v4' into bdsp/aut…
dayfine Nov 12, 2026
b6ec3bc
Merge branches 'bdsp/autostory-starter-rng-handoff' and 'bdsp/starter…
dayfine Nov 12, 2026
76f0726
BDSP AutoStory: red test: the Starter RNG handoff save checks the Ver…
dayfine Nov 13, 2026
1e40b62
BDSP AutoStory: the Starter RNG handoff save checks the card; one han…
dayfine Nov 13, 2026
5824ff6
BDSP AutoStory: document plan_story_run for Code Health
dayfine Nov 13, 2026
d141c1a
BDSP AutoStory: plan_story_run comment names its parameter
dayfine Nov 13, 2026
bf6e870
BDSP Starter RNG: red test: the default filter row is a shiny of any …
dayfine Nov 13, 2026
b0bb884
BDSP Starter RNG: set_default_shiny_row seeds the filter table; the s…
dayfine Nov 13, 2026
393c83d
Merge remote-tracking branch 'origin/bdsp/starter-rng-callable' into …
dayfine Nov 13, 2026
fa59f9c
Merge origin/bdsp/autostory-starter-rng-handoff into bdsp/autostory-s…
dayfine Nov 13, 2026
fe6aa23
BDSP AutoStory: Starter RNG default row, player model option, fatal o…
dayfine Nov 13, 2026
bd1b9da
BDSP AutoStory Starter RNG: lint fixes (private options, split tests …
dayfine Nov 13, 2026
29a2278
BDSP AutoStory Starter RNG: const filters accessor
dayfine Nov 13, 2026
89b2d42
BDSP AutoStory Starter RNG: drop const filters accessor
dayfine Nov 13, 2026
7a46b79
AutoStory: shared RNG handoff contract; BDSP Starter RNG adopts it
dayfine Nov 13, 2026
1836dd3
AutoStory: shared RNG handoff contract
dayfine Nov 13, 2026
00624b4
AutoStory RNG handoff: a program's end can be the user's turn
dayfine Nov 13, 2026
eed3b65
AutoStory RNG handoff: options struct for the mode, test table
dayfine Nov 13, 2026
bb44bba
Merge autostory/rng-handoff into bdsp/autostory-starter-rng
dayfine Nov 13, 2026
c4acda6
Merge autostory/rng-handoff (#445) into autostory/engine
dayfine Nov 13, 2026
9d96ad0
Merge bdsp/autostory-starter-rng (#439) into bdsp/starter-rng-callable
dayfine Nov 13, 2026
2569cc5
Merge branch 'nav/grid-nav' into autostory/engine (#360)
dayfine Nov 13, 2026
45a46f7
AutoStory RNG handoff: red test: a stop reports its message and lines
dayfine Nov 13, 2026
0877430
AutoStory RNG handoff: report_rng_handoff_stop, the stop's log, overl…
dayfine Nov 13, 2026
b7edc14
Merge commit '0877430cf' into bdsp/rng-handoff-work
dayfine Nov 13, 2026
c2c6ae9
BDSP AutoStory: the Starter RNG handoff takes the shared RngHandoffMo…
dayfine Nov 13, 2026
62142f2
Merge origin/bdsp/autostory-v4 into bdsp/starter-rng-callable
dayfine Nov 13, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -33,24 +33,24 @@ enum class Failure{
MISSING_RESOURCE,
};

struct AuthoredInput{
std::string name;
std::string json;
std::string game = "frlg";
bool resource = false;
std::string file = "plan";
};
struct AuthoredCase{
struct Input{
std::string name;
std::string json;
std::string game = "frlg";
bool resource = false;
std::string file = "plan";
};

struct AuthoredExpectation{
std::string checkpoint = "00.05";
std::string execution = R"({"menu":"before_pokedex"})";
std::vector<std::string> events = {"first", "second"};
Failure failure = Failure::NONE;
};
struct Expectation{
std::string checkpoint = "00.05";
std::string execution = R"({"menu":"before_pokedex"})";
std::vector<std::string> events = {"first", "second"};
Failure failure = Failure::NONE;
};

struct AuthoredCase{
AuthoredInput input;
AuthoredExpectation expectation;
Input input;
Expectation expectation;
};

const AuthoredCase CASES[] = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,28 +36,28 @@ enum class Record{
CHECKPOINT,
};

// A record to read, and which kind it is.
struct WireInput{
std::string_view name;
Record record = Record::STEP;
std::string_view json;
};

// What a read gives.
using ReadRecord = std::variant<GridPose, DeclaredPose, StoryStep, StoryCheckpoint>;

// "" when the record read is as expected, else what differs.
using ReadCheck = std::string (*)(const ReadRecord& record);

// What reading it gives: a record the check accepts, or a rejection.
struct WireExpectation{
ReadCheck check = nullptr;
bool rejected = false;
};

struct WireCase{
WireInput input;
WireExpectation expectation;
// A record to read, and which kind it is.
struct Input{
std::string_view name;
Record record = Record::STEP;
std::string_view json;
};

// What reading it gives: a record the check accepts, or a rejection.
struct Expectation{
ReadCheck check = nullptr;
bool rejected = false;
};

Input input;
Expectation expectation;
};

std::string expect(bool ok, std::string_view what){
Expand Down Expand Up @@ -201,7 +201,7 @@ std::vector<StoryActionSpec> test_actions(){


// `input` read.
ReadRecord read_record(const WireInput& input){
ReadRecord read_record(const WireCase::Input& input){
static const std::vector<StoryActionSpec> actions = test_actions();
const JsonValue value = parse_json(std::string(input.json));
switch (input.record){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,29 +83,29 @@ StoryGame<GridPose> engine_game(std::optional<int> candies){



// One engine run of 00.31 in `phase`, the player ending on `end_map`.
struct EngineInput{
std::string_view name;
std::string_view phase;
HashRecord hash = HashRecord::MATCHING;
std::string_view steps = TALK_STEPS;
// Where the talk leaves the player; empty: the talk opens no text.
std::string_view end_map = "RocketHideout_B3F";
std::optional<int> candies = 2;
};
struct EngineCase{
// One engine run of 00.31 in `phase`, the player ending on `end_map`.
struct Input{
std::string_view name;
std::string_view phase;
HashRecord hash = HashRecord::MATCHING;
std::string_view steps = TALK_STEPS;
// Where the talk leaves the player; empty: the talk opens no text.
std::string_view end_map = "RocketHideout_B3F";
std::optional<int> candies = 2;
};

// The save mode chosen, the verdict, whether the game saved (each save
// logs "[Test] save") and a line the run logged.
struct EngineExpectation{
StorySaveMode mode = StorySaveMode::NONE;
CheckpointVerdict verdict = CheckpointVerdict::PASSED;
size_t saves = 0;
std::string_view line = {};
};
// The save mode chosen, the verdict, whether the game saved (each save
// logs "[Test] save") and a line the run logged.
struct Expectation{
StorySaveMode mode = StorySaveMode::NONE;
CheckpointVerdict verdict = CheckpointVerdict::PASSED;
size_t saves = 0;
std::string_view line = {};
};

struct EngineCase{
EngineInput input;
EngineExpectation expectation;
Input input;
Expectation expectation;
};

const EngineCase ENGINE_CASES[] = {
Expand Down Expand Up @@ -201,23 +201,23 @@ class StoryEngineSaveTest : public UnitTest{



// Two checkpoints' events, hashed with the built-in actions.
struct HashInput{
std::string_view name;
std::string_view a;
std::string_view b;
};
struct HashCase{
// Two checkpoints' events, hashed with the built-in actions.
struct Input{
std::string_view name;
std::string_view a;
std::string_view b;
};

// Whether they hash the same, and `a`'s hash when pinned: a change to it
// means every recorded verification goes stale.
struct HashExpectation{
bool same = true;
std::optional<std::string_view> hash_a = std::nullopt;
};
// Whether they hash the same, and `a`'s hash when pinned: a change to it
// means every recorded verification goes stale.
struct Expectation{
bool same = true;
std::optional<std::string_view> hash_a = std::nullopt;
};

struct HashCase{
HashInput input;
HashExpectation expectation;
Input input;
Expectation expectation;
};

inline constexpr std::string_view ROUTE_B3F = R"([{"id": "go", "kind": "route", "args": {"target": {"map": "RocketHideout_B3F", "tiles": [[12, 13]]}}}])";
Expand Down Expand Up @@ -271,23 +271,23 @@ class StoryStepsHashTest : public UnitTest{



// A checkpoint's "metadata", read.
struct MetadataInput{
std::string_view name;
std::string_view metadata;
};
struct MetadataCase{
// A checkpoint's "metadata", read.
struct Input{
std::string_view name;
std::string_view metadata;
};

// The error the read throws (contained), or what it read.
struct MetadataExpectation{
std::string_view error = {};
StoryPhase phase = StoryPhase::TESTING;
std::string_view steps_hash = {};
size_t items = 0;
};
// The error the read throws (contained), or what it read.
struct Expectation{
std::string_view error = {};
StoryPhase phase = StoryPhase::TESTING;
std::string_view steps_hash = {};
size_t items = 0;
};

struct MetadataCase{
MetadataInput input;
MetadataExpectation expectation;
Input input;
Expectation expectation;
};

const MetadataCase METADATA_CASES[] = {
Expand Down Expand Up @@ -341,21 +341,21 @@ class StoryMetadataTest : public UnitTest{



// What a look showed, classified by ScreenMachine states that match on
// observations.
struct ScreenInput{
std::string_view name;
std::vector<ScreenEvent> events;
};
struct ScreenCase{
// What a look showed, classified by ScreenMachine states that match on
// observations.
struct Input{
std::string_view name;
std::vector<ScreenEvent> events;
};

// The state matched; none when no state did.
struct ScreenExpectation{
std::optional<std::string_view> state = std::nullopt;
};
// The state matched; none when no state did.
struct Expectation{
std::optional<std::string_view> state = std::nullopt;
};

struct ScreenCase{
ScreenInput input;
ScreenExpectation expectation;
Input input;
Expectation expectation;
};

const ScreenCase SCREEN_CASES[] = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Story Engine Runs Tests

Check warning on line 1 in SerialPrograms/Source/Pokemon/AutoStory/Engine/Pokemon_StoryEngineRuns_Tests.cpp

View workflow job for this annotation

GitHub Actions / code-health

Code health (advisory)

<file>: file_lines=743 (advisory above 500, limit 1000)
*
* From: https://github.com/PokemonAutomation/
*
Expand Down Expand Up @@ -585,22 +585,22 @@

// Gap 7: the first checkpoint is retried after a reload; one after it
// only when the one before saved at its end (#329).
struct SegmentInput{
std::string_view name;
StoryPhase phase;
// Which checkpoint fails once: 0 or 1.
size_t flaky = 0;
};
struct SegmentCase{
struct Input{
std::string_view name;
StoryPhase phase;
// Which checkpoint fails once: 0 or 1.
size_t flaky = 0;
};

struct SegmentExpectation{
bool completed = false;
size_t reloads = 0;
size_t saves = 0;
};
struct Expectation{
bool completed = false;
size_t reloads = 0;
size_t saves = 0;
};

struct SegmentCase{
SegmentInput input;
SegmentExpectation expectation;
Input input;
Expectation expectation;
};

const SegmentCase SEGMENT_CASES[] = {
Expand Down Expand Up @@ -675,20 +675,20 @@
}


// One check above, by name.
struct RunsInput{
std::string_view name;
std::string (*check)(CancellableScope& scope);
};
struct RunsCase{
// One check above, by name.
struct Input{
std::string_view name;
std::string (*check)(CancellableScope& scope);
};

// The check's error: none.
struct RunsExpectation{
std::string_view error = {};
};
// The check's error: none.
struct Expectation{
std::string_view error = {};
};

struct RunsCase{
RunsInput input;
RunsExpectation expectation;
Input input;
Expectation expectation;
};

const RunsCase RUNS_CASES[] = {
Expand Down
Loading
Loading