Predeclare the M11.9 playtests and add account-free play telemetry
M11.9a (ADR-0130): the repeated-life playtest plan fixes its questions, sample and recording before any session. summarize_cellular_play derives aggregates (population, death causes, lifespans, buds, mutations, variety) from a committed cellular state, and evo-world-clone summary prints them for a region head, read-only and without account data. The roadmap records M11 status. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -68,6 +68,7 @@
|
||||
#include "evo/persistence/sha256.hpp"
|
||||
#include "evo/processes/development_opening.hpp"
|
||||
#include "evo/server/lifecycle/cellular_lives.hpp"
|
||||
#include "evo/server/lifecycle/cellular_play_summary.hpp"
|
||||
#include "evo/server/lifecycle/primitive_lives.hpp"
|
||||
|
||||
#include <algorithm>
|
||||
@@ -226,7 +227,7 @@ std::optional<Options> parse(int argc, char** argv) {
|
||||
Options o;
|
||||
o.command = argv[1];
|
||||
if (o.command != "clone" && o.command != "audit" && o.command != "check-store" &&
|
||||
o.command != "provision" && o.command != "compare")
|
||||
o.command != "provision" && o.command != "compare" && o.command != "summary")
|
||||
return std::nullopt;
|
||||
const bool clone = o.command == "clone";
|
||||
for (int i = 2; i < argc; ++i) {
|
||||
@@ -329,7 +330,8 @@ std::optional<Options> parse(int argc, char** argv) {
|
||||
if (o.target.objects.empty())
|
||||
o.target.objects = o.source.objects;
|
||||
}
|
||||
const bool needs_builds = o.command != "check-store" && o.command != "provision";
|
||||
const bool needs_builds =
|
||||
o.command != "check-store" && o.command != "provision" && o.command != "summary";
|
||||
if (o.command == "provision") {
|
||||
if (o.opening.empty() || !o.build)
|
||||
return std::nullopt;
|
||||
@@ -743,6 +745,63 @@ int check_store(const Options& o) {
|
||||
return denied && reachable ? 0 : 3;
|
||||
}
|
||||
|
||||
// M11.9 (ADR-0130): read-only, account-free play aggregates of a cellular region's
|
||||
// committed head, for playtest review. Nothing is written.
|
||||
int summary(const Options& o) {
|
||||
auto db = connect(o.source);
|
||||
auto objects = open_objects(o.source, server::max_cellular_lives_bytes);
|
||||
if (!db || !objects) {
|
||||
std::fputs("summary failed store\n", stderr);
|
||||
return 3;
|
||||
}
|
||||
const auto head = persistence::load_region_checkpoint(*db, o.source.key, timeout);
|
||||
const auto manifest =
|
||||
head ? persistence::decode_manifest(head->manifest)
|
||||
: std::expected<persistence::CheckpointManifest, persistence::CheckpointError>{
|
||||
std::unexpected{persistence::CheckpointError::format}};
|
||||
if (!manifest || manifest->profile != persistence::CheckpointProfile::cellular_lives_v1) {
|
||||
std::fputs("summary failed head\n", stderr);
|
||||
return 3;
|
||||
}
|
||||
const auto payload = objects->get({manifest->payload_sha256, manifest->payload_bytes});
|
||||
auto state = payload ? persistence::restore_cellular_payload(*payload, *manifest)
|
||||
: std::unexpected{persistence::CheckpointError::payload};
|
||||
const auto play = state ? server::summarize_cellular_play(**state)
|
||||
: std::unexpected{server::CellularLivesError::format};
|
||||
if (!play) {
|
||||
std::fputs("summary failed state\n", stderr);
|
||||
return 3;
|
||||
}
|
||||
std::printf("cellular summary world=%llu region=%llu sequence=%llu tick=%llu\n",
|
||||
static_cast<unsigned long long>(o.source.key.world),
|
||||
static_cast<unsigned long long>(o.source.key.region),
|
||||
static_cast<unsigned long long>(manifest->sequence),
|
||||
static_cast<unsigned long long>(play->tick));
|
||||
std::printf("living owned=%llu wildlife=%llu lingering=%llu suspended=%llu\n",
|
||||
static_cast<unsigned long long>(play->owned),
|
||||
static_cast<unsigned long long>(play->wildlife),
|
||||
static_cast<unsigned long long>(play->lingering),
|
||||
static_cast<unsigned long long>(play->suspended));
|
||||
std::printf("deaths total=%llu starved=%llu engulfed=%llu unrecorded=%llu owned=%llu "
|
||||
"wildlife=%llu\n",
|
||||
static_cast<unsigned long long>(play->deaths),
|
||||
static_cast<unsigned long long>(play->starved),
|
||||
static_cast<unsigned long long>(play->engulfed),
|
||||
static_cast<unsigned long long>(play->unrecorded),
|
||||
static_cast<unsigned long long>(play->owned_deaths),
|
||||
static_cast<unsigned long long>(play->wildlife_deaths));
|
||||
std::printf("lifespan_ticks min=%llu median=%llu max=%llu\n",
|
||||
static_cast<unsigned long long>(play->lifespan_min),
|
||||
static_cast<unsigned long long>(play->lifespan_median),
|
||||
static_cast<unsigned long long>(play->lifespan_max));
|
||||
std::printf("evolution buds=%llu mutations=%llu living_genomes=%llu deepest_lineage=%llu\n",
|
||||
static_cast<unsigned long long>(play->buds),
|
||||
static_cast<unsigned long long>(play->mutations),
|
||||
static_cast<unsigned long long>(play->living_genomes),
|
||||
static_cast<unsigned long long>(play->deepest_lineage));
|
||||
return 0;
|
||||
}
|
||||
|
||||
int audit(const Options& o) {
|
||||
auto db = connect(o.source);
|
||||
auto objects = open_objects(o.source);
|
||||
@@ -882,7 +941,7 @@ int clone(const Options& o) {
|
||||
int main(int argc, char** argv) {
|
||||
const auto options = parse(argc, argv);
|
||||
if (!options) {
|
||||
std::fputs("usage: evo-world-clone clone|audit|check-store|provision|compare ... "
|
||||
std::fputs("usage: evo-world-clone clone|audit|check-store|provision|compare|summary ... "
|
||||
"(see apps/evo-world-clone/main.cpp)\n",
|
||||
stderr);
|
||||
return 2;
|
||||
@@ -893,5 +952,7 @@ int main(int argc, char** argv) {
|
||||
return provision(*options);
|
||||
if (options->command == "compare")
|
||||
return compare(*options);
|
||||
if (options->command == "summary")
|
||||
return summary(*options);
|
||||
return options->command == "clone" ? clone(*options) : audit(*options);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user