Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
dab4c30
Step 11: add deterministic cardinal pathfinder
MerverliPy Jul 19, 2026
600973c
Fix pathfinder canonical neighbor storage
MerverliPy Jul 19, 2026
db040d2
Step 11: add deterministic pathfinding tests
MerverliPy Jul 19, 2026
bc4f84d
Step 11: register pathfinding milestone tests
MerverliPy Jul 19, 2026
c111726
Add canonical movement agent component state
MerverliPy Jul 19, 2026
87c61f2
Add deterministic authoritative movement planner
MerverliPy Jul 19, 2026
4e60c36
Test canonical movement state and authoritative planning
MerverliPy Jul 19, 2026
2f97e09
Register movement state and planner tests
MerverliPy Jul 19, 2026
f87776e
Add deterministic component replacement primitive
MerverliPy Jul 19, 2026
3016515
Expose authoritative component replacement to Commit pipeline
MerverliPy Jul 19, 2026
5362fa4
Add deterministic component replacement mutation kind
MerverliPy Jul 19, 2026
f52c5f0
Add buffered deterministic component replacement
MerverliPy Jul 19, 2026
93bb5b5
test: validate buffered component replacement
MerverliPy Jul 19, 2026
480e3cc
test: register component replacement validation
MerverliPy Jul 19, 2026
29261bd
Add Step 11 Release validation workflow
MerverliPy Jul 19, 2026
576783f
Fix replacement test typing and checksum isolation
MerverliPy Jul 19, 2026
bf52cf8
CI: surface concise Step 11 compiler diagnostics
MerverliPy Jul 19, 2026
3ba8024
ci: upload Step 11 build diagnostics
MerverliPy Jul 19, 2026
9badf51
Fix array reverse overload resolution in tests
MerverliPy Jul 19, 2026
5ecaabd
docs: add Step 11 movement core CI-validated handoff
MerverliPy Jul 19, 2026
ecb0944
test: add movement save load continuity coverage
MerverliPy Jul 19, 2026
3bcc9ce
test: register movement save load continuity tests
MerverliPy Jul 19, 2026
fd76da5
Add movement replay equivalence coverage
MerverliPy Jul 19, 2026
95f2e9c
Register movement replay equivalence test
MerverliPy Jul 19, 2026
aa6f7ad
Fix movement replay CI compile errors
MerverliPy Jul 19, 2026
f8bf993
Add movement frame-pattern checksum equivalence test
MerverliPy Jul 19, 2026
5b60f88
Register movement frame-pattern equivalence test
MerverliPy Jul 19, 2026
c8aa1d3
Fix movement frame-pattern speed profile import
MerverliPy Jul 19, 2026
c793eaa
Add deterministic dynamic-obstruction movement soak
MerverliPy Jul 19, 2026
db02e64
Register dynamic-obstruction movement soak test
MerverliPy Jul 19, 2026
5241877
Trigger Step 11 validation after soak registration ref correction
MerverliPy Jul 19, 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
50 changes: 50 additions & 0 deletions .github/workflows/step11-validation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Step 11 Validation

on:
pull_request:
branches:
- main
push:
branches:
- step11/deterministic-pathfinding-movement

permissions:
contents: read

jobs:
release-validation:
runs-on: ubuntu-latest
timeout-minutes: 10

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup .NET 8
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x

- name: Restore
run: dotnet restore GenerationArk.Simulation.Tests/GenerationArk.Simulation.Tests.csproj --verbosity quiet

- name: Build Release
id: build
shell: bash
run: |
set +e
dotnet build GenerationArk.Simulation.Tests/GenerationArk.Simulation.Tests.csproj --configuration Release --no-restore --verbosity minimal > step11-build.log 2>&1
status=$?
cat step11-build.log
exit $status

- name: Upload build diagnostics
if: always()
uses: actions/upload-artifact@v4
with:
name: step11-build-diagnostics
path: step11-build.log
if-no-files-found: error

- name: Run exact harness
run: dotnet run --project GenerationArk.Simulation.Tests/GenerationArk.Simulation.Tests.csproj --configuration Release --no-build
239 changes: 239 additions & 0 deletions Generation-Ark-Session-Handoff-Step11-Movement-Core-CI-Validated.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,239 @@
# Generation Ark — Session Handoff: Step 11 Movement Core CI Validated

## Status

Step 11 movement-core implementation is active on a draft pull request. The current branch has a successful Release build and an exact 81/81 test-harness result in GitHub Actions. Movement persistence, replay continuity, frame-pattern equivalence, dynamic-obstruction soak, and owner validation are not yet complete.

This file is the authoritative baseline for the next Step 11 phase.
Comment on lines +5 to +7

## Repository and branch

- Repository: `MerverliPy/Generation-Ark`
- Base branch: `main`
- Active branch: `step11/deterministic-pathfinding-movement`
- Draft pull request: `#3`
- Validated branch head: `9badf518f0b12c875ccb7642d510593b548fa1a5`
- Step 10 validated main commit: `f6be88e0c7c273899263661e31fb6c9639b006f8`
- Step 10 source commit: `03ac1cfd8cab11011c205bedf4ee3bae88265784`

## Validation evidence

- Workflow: `Step 11 Validation`
- Workflow run: `29697124585`
- Job: `release-validation`
- Restore: passed
- Release build: passed
- Warnings-as-errors gate: passed
- Exact console harness: passed
- Test result: `81/81`
- Runner OS: Ubuntu 24.04
- Target framework: .NET 8

The pull request must remain draft and unmerged until all remaining Step 11 gates and owner validation are complete.

## Preserved backup

Do not remove or overwrite:

`/home/calvin/Generation-Ark/generation-ark-clock-before-git-sync-20260719T164917Z.tar.gz`

## Completed Step 11 movement core

### Deterministic pathfinding

- Deterministic cardinal pathfinding is implemented.
- Neighbor traversal and tie-breaking use canonical `MapCellId` ordering.
- Blocked cells are avoided.
- Blocked destinations fail deterministically.
- Repathing after obstruction changes is deterministic.
- A 100-agent concurrent-route test is registered and passing.

### Movement state

`MovementAgentState` is the authoritative movement component and includes:

- current cell
- destination cell
- movement revision
- canonical registration
- canonical serialization and deserialization
- checksum participation

### Movement planning

`AuthoritativeMovementPlanner`:

- advances exactly one canonical cell per planning call
- does not mutate authoritative world state directly
- produces Commit-bound replacement intent
- reuses the existing world, mutation, Commit, save, replay, and checksum architecture

## Component replacement infrastructure

Replacement support was added to the existing component and mutation pipeline.

### Component store

`ComponentStore.Replace(EntityId, object)`:

- rejects null values
- requires the exact registered runtime type
- requires the component to already exist
- replaces the stored value without changing component identity

### Component registry

`ComponentRegistry.Replace(EntityRegistry, EntityId, ComponentValue)`:

- validates arguments
- requires the entity to exist
- delegates to the registered component store

### Mutation kind

`EntityMutationKind.ReplaceComponent = 5`

Existing enum numeric values were preserved:

- `CreateEntity = 1`
- `DestroyEntity = 2`
- `AddComponent = 3`
- `RemoveComponent = 4`
- `ReplaceComponent = 5`

### Mutation buffer semantics

`MutationBuffer` now supports `EnqueueReplace` and applies replacements through the existing Commit path.

Validation requires:

- the entity exists
- the component type is registered
- the replacement runtime type exactly matches the registration
- the entity already owns the component

Conflict rules reject atomically:

- replace + replace for the same entity/component
- add + replace for the same entity/component
- remove + replace for the same entity/component
- destroy + replace for the same entity
- any multiple structural component mutations targeting the same entity/component in one batch

Replacement remains invisible until Commit.

## Focused replacement tests

The following tests are registered and passing:

- `ReplacementRemainsInvisibleUntilCommitAndThenApplies`
- `ConflictingReplacementsRejectAtomically`
- `MovementReplacementChangesCanonicalChecksum`

The checksum test compares states at the same tick so divergence is attributable to movement state rather than clock state.

## CI infrastructure

`.github/workflows/step11-validation.yml` runs on the Step 11 branch and pull request.

It performs:

1. checkout
2. .NET 8 setup
3. restore
4. Release build
5. build-diagnostics artifact upload
6. exact console harness execution

The workflow preserves the real build exit status and uploads `step11-build.log` even when compilation fails.

A small test-namespace array `Reverse` extension delegates explicitly to LINQ to avoid .NET array overload resolution selecting the in-place `void` overload in existing map tests.

## Current test count

The authoritative registered test count is:

`81/81`

This supersedes the Step 10 `72/72` baseline for the active Step 11 branch only. It does not complete Step 11.

## Next authoritative work: movement persistence and replay continuity

Continue from validated head `9badf518f0b12c875ccb7642d510593b548fa1a5`.

Implement and validate movement continuity through the existing persistence and replay pipelines. Do not create parallel infrastructure.

Required next gates:

### 1. Save/load continuity

- Persist `MovementAgentState` through the existing entity/component snapshot pipeline.
- Restore authoritative current cell, destination, and revision exactly.
- Verify canonical serialized bytes or canonical restored state.
- Verify uninterrupted execution and save/load-resumed execution produce identical final checksums.

### 2. Replay equivalence

- Record movement-driving commands or deterministic movement inputs through the existing replay log.
- Re-run from the same seed and initial state.
- Verify checkpoint and final checksum equivalence.
- Ensure replacement mutation sequencing remains stable across replay.

### 3. Frame-pattern equivalence

- Run the same movement scenario under multiple frame budgets and frame patterns.
- Verify identical tick outcomes, movement positions, revisions, and canonical checksums.
- Confirm no frame-rate-dependent path planning or movement advancement exists.

### 4. Dynamic-obstruction deterministic soak

- Include at least 100 concurrently moving agents.
- Apply deterministic obstruction changes over a long run.
- Require deterministic repathing and completion/failure behavior.
- Compare repeated runs and varied frame patterns.
- Retain bounded checkpoints.
- Verify final checksum equivalence.

### 5. Owner validation

After CI is green for all Step 11 gates, owner validation must still produce retained evidence showing:

- exact branch and commit SHA
- .NET SDK version
- Release build result
- zero warnings and zero errors
- exact final test count
- soak and continuity evidence
- backup preservation

Do not mark the PR ready, merge it, close issue `#1`, or claim Step 11 complete before owner evidence exists.

## Explicit exclusions

Do not begin or introduce:

- jobs or toils
- reservation systems
- needs or routines
- atmosphere simulation
- Unity presentation work
- a second simulation runner
- a second simulation clock
- a second world root
- a parallel Commit pipeline
- a parallel save/load format
- a parallel checksum pipeline

## Guardrails

- Preserve deterministic ordering everywhere.
- Preserve all existing enum numeric values.
- Preserve the Step 10 validated behavior and tests.
- Reuse the existing mutation, Commit, persistence, replay, scheduler, and checksum systems.
- Treat GitHub CI as development evidence, not owner validation.
- Keep PR #3 draft and unmerged until every remaining gate passes.
- Keep the preserved backup intact.

## Immediate next step

Add movement save/load continuity tests and the minimum persistence integration needed to make them pass. Then run the existing `Step 11 Validation` workflow and act only on concrete build or test evidence.
14 changes: 14 additions & 0 deletions GenerationArk.Simulation.Tests/ArrayEnumerableExtensions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;

namespace GenerationArk.Simulation.Tests;

internal static class ArrayEnumerableExtensions
{
public static IEnumerable<T> Reverse<T>(this T[] source)
{
ArgumentNullException.ThrowIfNull(source);
return Enumerable.Reverse(source);
}
}
Loading
Loading