wip: Core.Liminal.Field v1 recipe, 4 seed-selected variants between fixed mouths (L144, fails mouth joins)
Plans and draws flat field+monolith, repeating hills, road over cloud floor and pillar grid in a 3-strata fixture, binding passage/0-1 and 1-2 as fixed endpoints. Composed W1 probes: 3/4 seeds fail one passage interface, 4/4 fail the liminal walk audit near the mouths (support itself passes). Stopped per AGENTS.md. Same mouth-ownership failure class as FI (L133/L140) and VS seed 2 (L139). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016dhxM43dnWvUu2B5Ph1iG1
This commit is contained in:
1 parent
a4e214561f
commit
a45ba9bb10
18 files changed
+1547
-43
No files matched your search
@@ -1835,25 +1835,6 @@ int main(int argc,char** argv)
|
||||
&&!StandaloneWorldAssemblyPrototype::AttachFloatingIslandWorldAssembly(
|
||||
*ownerWorld,ownerJsonRoot,worldAssembly,error))
|
||||
{std::fprintf(stderr,"Floating-island assembly setup failed: %s\n",error.c_str());return 2;}
|
||||
if(!options.WorldAssemblyManifestOutputPath.empty())
|
||||
{
|
||||
const std::string manifestText=worldAssembly.ToJson();
|
||||
const auto& outputPath=options.WorldAssemblyManifestOutputPath;
|
||||
std::error_code directoryError;
|
||||
if(!outputPath.parent_path().empty())
|
||||
std::filesystem::create_directories(outputPath.parent_path(),directoryError);
|
||||
if(directoryError)
|
||||
{std::fprintf(stderr,"Could not create the complete world assembly manifest output directory.\n");return 2;}
|
||||
std::ofstream output(outputPath,std::ios::binary);
|
||||
if(!output)
|
||||
{std::fprintf(stderr,"Could not open the complete world assembly manifest output path.\n");return 2;}
|
||||
output.write(manifestText.data(),static_cast<std::streamsize>(manifestText.size()));
|
||||
if(!output)
|
||||
{std::fprintf(stderr,"Could not write the complete world assembly manifest payload.\n");return 2;}
|
||||
std::printf("[WorldAssemblerFullManifest] bytes=%zu surface_strates=%zu floating_islands=%zu path=%s status=PASS\n",
|
||||
manifestText.size(),worldAssembly.plan.strates.size(),worldAssembly.floatingIslands.size(),
|
||||
outputPath.string().c_str());
|
||||
}
|
||||
if (options.AuditHeightfieldProfile && !RunHeightfieldProfileAudit(worldAssembly))
|
||||
{
|
||||
std::fprintf(stderr,"Profiled SurfaceWorld interval, classification or route audit failed.\n");
|
||||
@@ -1878,6 +1859,146 @@ int main(int argc,char** argv)
|
||||
&&!StandaloneWorldAssemblyPrototype::ValidateExportedCorePlanMatchesOwner(
|
||||
*ownerWorld,worldAssembly,resolvedLayout,error))
|
||||
{std::fprintf(stderr,"Unreal-resolved Core plan/owner slot validation failed: %s\n",error.c_str());return 2;}
|
||||
const VFJson::Value& coreLiminalConfig=ownerJsonRoot.Get("core_liminal_field");
|
||||
const bool hasCoreLiminalField=!std::holds_alternative<std::nullptr_t>(
|
||||
coreLiminalConfig.Data);
|
||||
if(hasCoreLiminalField)
|
||||
{
|
||||
const VFJson::Value& versionValue=coreLiminalConfig.Get("version");
|
||||
const VFJson::Value& strateValue=coreLiminalConfig.Get("strate_index");
|
||||
const std::int64_t strateIndex=strateValue.IsNumber()
|
||||
?strateValue.Integer():-1;
|
||||
const auto* policy=std::get_if<std::string>(&coreLiminalConfig.Get("variant_policy").Data);
|
||||
if(!coreLiminalConfig.IsObject()
|
||||
||!versionValue.IsNumber()
|
||||
||versionValue.Number()!=VoxelForgeCore::CoreLiminalFieldRecipeVersionV1
|
||||
||!strateValue.IsNumber()
|
||||
||std::trunc(strateValue.Number())!=strateValue.Number()
|
||||
||strateValue.Number()<0.0
|
||||
||strateValue.Number()>std::numeric_limits<std::int32_t>::max()
|
||||
||strateIndex<0||!policy||*policy!="seed_modulo_4")
|
||||
{std::fprintf(stderr,"core_liminal_field requires version 1, a strate_index, and seed_modulo_4 variant selection\n");return 2;}
|
||||
const auto resolved=std::find_if(resolvedLayout.strates.begin(),resolvedLayout.strates.end(),
|
||||
[&](const auto& value){return value.strateIndex==strateIndex
|
||||
&&value.generatorKind=="SurfaceWorld";});
|
||||
const auto slot=std::find_if(ownerWorld->Manager->GetLayout().begin(),
|
||||
ownerWorld->Manager->GetLayout().end(),[&](const auto& value)
|
||||
{return value.StrateIndex==strateIndex&&value.Definition;});
|
||||
if(resolved==resolvedLayout.strates.end()||slot==ownerWorld->Manager->GetLayout().end())
|
||||
{std::fprintf(stderr,"Core.Liminal.Field must target a resolved SurfaceWorld owner slot\n");return 2;}
|
||||
const auto order=static_cast<std::size_t>(resolved-resolvedLayout.strates.begin());
|
||||
if(order==0||order+1>=resolvedLayout.strates.size()
|
||||
||resolvedLayout.strates.size()!=3
|
||||
||resolvedLayout.strates[order-1].generatorKind!="SurfaceWorld"
|
||||
||resolvedLayout.strates[order+1].generatorKind!="TunnelNetwork")
|
||||
{std::fprintf(stderr,"Core.Liminal.Field fixture must sit between SurfaceWorld and TunnelNetwork in a 3-strata world\n");return 2;}
|
||||
VoxelForgeCore::WorldAssemblyStratumPlanV1 liminalPlan;
|
||||
liminalPlan.strateIndex=static_cast<std::int32_t>(strateIndex);
|
||||
liminalPlan.topChunkZ=slot->TopChunkZ;
|
||||
liminalPlan.bottomChunkZ=slot->BottomChunkZ;
|
||||
if(!VoxelForgeCore::PlanCoreLiminalFieldV1(worldAssembly.recipe,
|
||||
liminalPlan,resolvedLayout,error))
|
||||
{std::fprintf(stderr,"Core.Liminal.Field planning failed: %s\n",error.c_str());return 2;}
|
||||
worldAssembly.plan.strates.push_back(std::move(liminalPlan));
|
||||
if(!worldAssembly.finalize(error))
|
||||
{std::fprintf(stderr,"Core.Liminal.Field manifest finalization failed: %s\n",error.c_str());return 2;}
|
||||
const std::string canonicalManifest=worldAssembly.ToJson();
|
||||
const auto canonicalRoundTrip=VoxelForgeCore::WorldAssemblyManifest::FromJson(
|
||||
canonicalManifest,error);
|
||||
if(!canonicalRoundTrip||canonicalRoundTrip->ToJson()!=canonicalManifest
|
||||
||canonicalRoundTrip->contentHash!=worldAssembly.contentHash)
|
||||
{std::fprintf(stderr,"Core.Liminal.Field manifest failed canonical JSON round-trip: %s\n",error.c_str());return 2;}
|
||||
const auto plan=std::find_if(worldAssembly.plan.strates.begin(),
|
||||
worldAssembly.plan.strates.end(),[&](const auto& value)
|
||||
{return value.strateIndex==strateIndex&&value.liminalField.version!=0;});
|
||||
if(plan==worldAssembly.plan.strates.end())
|
||||
{std::fprintf(stderr,"Core.Liminal.Field finalized plan is missing\n");return 2;}
|
||||
auto& resolvedLiminal=*std::find_if(resolvedLayout.strates.begin(),
|
||||
resolvedLayout.strates.end(),[&](const auto& value)
|
||||
{return value.strateIndex==strateIndex;});
|
||||
resolvedLiminal.recipeId=std::string(VoxelForgeCore::CoreLiminalFieldRecipeIdV1);
|
||||
resolvedLiminal.recipeVersion=VoxelForgeCore::CoreLiminalFieldRecipeVersionV1;
|
||||
resolvedLiminal.anchors.erase(std::remove_if(resolvedLiminal.anchors.begin(),
|
||||
resolvedLiminal.anchors.end(),[](const auto& anchor)
|
||||
{return anchor.kind=="heightfield_profile";}),resolvedLiminal.anchors.end());
|
||||
VoxelForgeCore::ResolvedLayoutAnchorV2 profileAnchor;
|
||||
profileAnchor.kind="heightfield_profile";
|
||||
profileAnchor.stableId="heightfield-profile/liminal/"
|
||||
+std::to_string(static_cast<std::uint32_t>(plan->surfaceProfile.kind));
|
||||
profileAnchor.units="profile kind enum";
|
||||
profileAnchor.values={1,static_cast<std::int64_t>(plan->surfaceProfile.kind)};
|
||||
resolvedLiminal.anchors.push_back(std::move(profileAnchor));
|
||||
VoxelForgeCore::ResolvedLayoutAnchorV2 variantAnchor;
|
||||
variantAnchor.kind="liminal_variant";variantAnchor.stableId="liminal-field/variant";
|
||||
variantAnchor.units="version,variant,seed,1/256 Core voxel";
|
||||
variantAnchor.values={plan->liminalField.version,
|
||||
static_cast<std::int64_t>(plan->liminalField.variant),plan->liminalField.seed,
|
||||
plan->liminalField.floorHeightSubvoxels,
|
||||
plan->liminalField.routeHalfWidthSubvoxels,
|
||||
plan->liminalField.routeHalfThicknessSubvoxels};
|
||||
resolvedLiminal.anchors.push_back(std::move(variantAnchor));
|
||||
for(std::size_t pointIndex=0;pointIndex<plan->route.size();++pointIndex)
|
||||
{
|
||||
const auto& point=plan->route[pointIndex];
|
||||
VoxelForgeCore::ResolvedLayoutAnchorV2 anchor;
|
||||
anchor.kind="liminal_route_point";
|
||||
anchor.stableId="liminal-field/route/"+std::to_string(pointIndex);
|
||||
anchor.units="1/256 Core voxel";
|
||||
anchor.values={point.positionSubvoxels[0],point.positionSubvoxels[1],
|
||||
point.positionSubvoxels[2],point.radiusSubvoxels};
|
||||
resolvedLiminal.anchors.push_back(std::move(anchor));
|
||||
}
|
||||
if(!resolvedLayout.finalize(error))
|
||||
{std::fprintf(stderr,"Core.Liminal.Field resolved layout finalization failed: %s\n",error.c_str());return 2;}
|
||||
std::vector<VoxelForgeCore::ResolvedLayoutIssueV2> strictIssues;
|
||||
std::string strictError;
|
||||
if(!resolvedLayout.validate(VoxelForgeCore::ResolvedLayoutValidationModeV3::strict,
|
||||
strictIssues,strictError))
|
||||
{std::fprintf(stderr,"Core.Liminal.Field resolved layout failed strict validation: %s\n",strictError.c_str());return 2;}
|
||||
VFJson::Value assemblyValue;
|
||||
if(!VFJson::Parser(worldAssembly.ToJson()).Parse(assemblyValue,error))
|
||||
{std::fprintf(stderr,"Core.Liminal.Field manifest JSON encoding failed: %s\n",error.c_str());return 2;}
|
||||
auto* rootObject=std::get_if<VFJson::Value::Object>(&ownerJsonRoot.Data);
|
||||
if(!rootObject)
|
||||
{std::fprintf(stderr,"Core.Liminal.Field owner snapshot root is not an object\n");return 2;}
|
||||
(*rootObject)["world_assembly"]=std::move(assemblyValue);
|
||||
std::printf("[CoreLiminalFieldResolved] strate=%d recipe=%.*s version=%u variant=%u seed=%u arrival=%s departure=%s route_points=%zu status=PASS\n",
|
||||
static_cast<int>(strateIndex),static_cast<int>(VoxelForgeCore::CoreLiminalFieldRecipeIdV1.size()),
|
||||
VoxelForgeCore::CoreLiminalFieldRecipeIdV1.data(),plan->liminalField.version,
|
||||
static_cast<unsigned>(plan->liminalField.variant),plan->liminalField.seed,
|
||||
resolvedLayout.passages.front().stableId.c_str(),resolvedLayout.passages.back().stableId.c_str(),
|
||||
plan->route.size());
|
||||
std::vector<VoxelForgeCore::ResolvedLayoutStampRequestV1> liminalRequests;
|
||||
if(!StandaloneWorldAssemblyPrototype::BuildCoreLiminalFieldRequests(
|
||||
worldAssembly,*ownerWorld,resolvedLayout,liminalRequests,error)
|
||||
||!VoxelForgeCore::ResolveResolvedLayoutStampsV1(
|
||||
resolvedLayout,seed,liminalRequests,error))
|
||||
{std::fprintf(stderr,"Core.Liminal.Field drawing plan failed: %s\n",error.c_str());return 2;}
|
||||
std::printf("[CoreLiminalFieldDraw] variant=%u stamps=%zu deck=1 supports=%zu status=PASS\n",
|
||||
static_cast<unsigned>(plan->liminalField.variant),resolvedLayout.stamps.size(),
|
||||
static_cast<std::size_t>(std::count_if(resolvedLayout.stamps.begin(),
|
||||
resolvedLayout.stamps.end(),[](const auto& stamp)
|
||||
{return stamp.stableId.starts_with("core/liminal-field/route/support/");})));
|
||||
}
|
||||
if(!options.WorldAssemblyManifestOutputPath.empty())
|
||||
{
|
||||
const std::string manifestText=worldAssembly.ToJson();
|
||||
const auto& outputPath=options.WorldAssemblyManifestOutputPath;
|
||||
std::error_code directoryError;
|
||||
if(!outputPath.parent_path().empty())
|
||||
std::filesystem::create_directories(outputPath.parent_path(),directoryError);
|
||||
if(directoryError)
|
||||
{std::fprintf(stderr,"Could not create the complete world assembly manifest output directory.\n");return 2;}
|
||||
std::ofstream output(outputPath,std::ios::binary);
|
||||
if(!output)
|
||||
{std::fprintf(stderr,"Could not open the complete world assembly manifest output path.\n");return 2;}
|
||||
output.write(manifestText.data(),static_cast<std::streamsize>(manifestText.size()));
|
||||
if(!output)
|
||||
{std::fprintf(stderr,"Could not write the complete world assembly manifest payload.\n");return 2;}
|
||||
std::printf("[WorldAssemblerFullManifest] bytes=%zu surface_strates=%zu floating_islands=%zu path=%s status=PASS\n",
|
||||
manifestText.size(),worldAssembly.plan.strates.size(),worldAssembly.floatingIslands.size(),
|
||||
outputPath.string().c_str());
|
||||
}
|
||||
const bool hasMotifFamily=!std::holds_alternative<std::nullptr_t>(
|
||||
ownerJsonRoot.Get("motif_family_override").Data);
|
||||
const bool hasLiminalRoad=!std::holds_alternative<std::nullptr_t>(
|
||||
@@ -1887,6 +2008,8 @@ int main(int argc,char** argv)
|
||||
if((hasMotifFamily&&hasLiminalRoad)||(hasMotifFamily&&hasLiminalPillarGrid)
|
||||
||(hasLiminalRoad&&hasLiminalPillarGrid))
|
||||
{std::fprintf(stderr,"liminal content overrides must be used in separate fixtures\n");return 2;}
|
||||
if(hasCoreLiminalField&&(hasMotifFamily||hasLiminalRoad||hasLiminalPillarGrid))
|
||||
{std::fprintf(stderr,"Core.Liminal.Field owns its variant geometry and cannot be combined with prototype content overrides\n");return 2;}
|
||||
if(hasMotifFamily)
|
||||
{
|
||||
std::vector<VoxelForgeCore::ResolvedLayoutStampRequestV1> requests;
|
||||
|
||||
Reference in new issue
Block a user