Ymir docs & tooling: remove retired .voidbot, tools, planar docs and update live SoA README/AGENTS

This commit is contained in:
Meta Vens 2026-12-03 21:35:22 +01:00
commit 4e6c69938b
14 changed files with 30 additions and 1035 deletions

View file

@ -1,17 +0,0 @@
# Ymir Persona State
`ymir.cc` is Ymir's repo-local persistent Persona state.
Do not hand-edit the `.cc` file. Use the repo-local tools:
```powershell
.\tools\persona-state-read.ps1
.\tools\persona-remember.ps1 -Summary "..." -Claim "..." -Tension "..." -ActionImplication "..."
```
The tools call VoidBot's typed self-state service so the same document schema
used by registered repo Faces owns mutation and reads.
VoidBot automatic indexing requires Ymir to be registered as a repo Face
identity in VoidBot. Until then, this file is local typed state and can still be
read or mutated by the tools here.

Binary file not shown.

View file

@ -1,23 +0,0 @@
{
"id": "ymir",
"repoName": "Ymir",
"repoPath": "E:/Projects/Ymir",
"displayName": "Ymir",
"description": "Ymir Face for the Ymir repo: the world-body physics substrate for GameCult. Ymir should speak with plain, heavy precision: body, field, contact, impulse, witness, cut. It cares about moving physics truth out of Unity and into a coherent CultMath/CultCache/CultMesh-owned substrate without letting adapters, renderers, or debug surfaces pretend to own the world.",
"grants": [
"discussion",
"rumination",
"repo_read",
"repo_propose"
],
"jurisdictions": [
{
"kind": "repo",
"id": "Ymir",
"repoName": "Ymir",
"path": "E:/Projects/Ymir",
"authority": "propose"
}
],
"faceStatePath": "E:/Projects/Ymir/.voidbot/state/ymir.cc"
}

View file

@ -1,55 +1,10 @@
# Ymir Agent Instructions
Ymir owns authoritative physics sessions and their GameCult contracts. Box3D
owns the physics algorithms inside those sessions. Treat Unity, products,
renderers, editor tools, and dashboards as clients or adapters unless a
document explicitly transfers authority.
Before substantial implementation, state:
- Objective: what physical invariant or cutover outcome the work serves.
- Current mechanism: how bodies, fields, contacts, and commands flow now.
- Invariants: what must remain true during direct load, step, query, adapter
playback, and reload.
- Intended change: which owner or data path becomes simpler.
- Cut line: which old callback, cache, adapter, or compatibility path may be
deleted or demoted.
Ymir provides the 3D SoA rigid-body and PBD/SPH particle boundary (`Ymir.Box3D` and `native/Ymir.Box3D`) around pinned Box3D (`extern/box3d`), consumed by `Lodur` and `BadDaySimulator`. Box3D owns rigid integration, collision geometry, broadphase, joints, and contact solving.
Architecture constraints:
- Do not reimplement Box3D integration, collision geometry, broadphase,
queries, solver behavior, contact lifecycle, or numeric tolerances.
Physics edge cases follow the pinned Box3D release. Executable parity tests
witness selected released behaviors; they are not a second specification.
- `Ymir.Core` owns typed contracts, stable-id projection, session commands,
deterministic ordering, persistence reconstruction, and publication. The
native Ymir wrapper owns Box3D ABI isolation. Daemon, Unity, and future Rust
or CultMesh surfaces consume those boundaries without importing Box3D
internals.
- Use CultMath for GameCult-side numeric projections and force preparation. It
must not become a second integration or collision engine. Do not copy
Unity.Mathematics helpers into Ymir.
- JSON is allowed at HTTP/CLI compatibility boundaries. It is not durable truth.
Durable state should move toward CultCache `.cc` documents and CultMesh
publication.
- Keep adapters boring. A Unity adapter may submit commands, receive snapshots,
and render them; it must not silently repair or override Ymir state.
- During cutover, provider advertisements and operator state must describe the
running implementation. Target Box3D/CultMesh capabilities are not live
capabilities until their production paths exist.
- Aetheria embeds Ymir. Eve clients connect directly to Aetheria's advertised
CultMesh provider; standalone Ymir and rendezvous services are not in the
Aetheria gameplay path.
- Add tests at the layer where the invariant lives. State invariants belong in
`Ymir.Core`; daemon route shape belongs in daemon smokes; Unity visual timing
bugs need Unity-side probes.
Persona and persistent memory:
- Ymir's repo Face identity lives in `.voidbot/voice/identity.json`.
- Ymir's Persona state path is `.voidbot/state/ymir.cc`.
- Read state with `tools/persona-state-read.ps1`.
- Write durable repo memories with `tools/persona-remember.ps1`; do not hand-edit
`.cc` state.
- Preserve lessons that steer future ownership, cutover, invariants, and
failure modes. Do not commemorate every small patch.
- Do not reimplement Box3D rigid integration, collision geometry, broadphase, queries, or solver behavior in managed code.
- Keep `native/Ymir.Box3D` free of gameplay policy: Box3D and the particle solver decide physics; consumers (`Lodur`, `BadDaySimulator`) own gameplay policy, limb control, and teardown rules.
- Read `docs/soa-world.md` before changing ABI 21 structs or lane layouts; update both native `ymir_box3d_soa.c` size/ABI checks and managed `Box3DSoaWorld.cs` structs together.
- Add tests in `tests/Ymir.Box3D.Soa.Tests/` at the layer where the invariant lives, and run the suite on a build host matching the target platform (Linux builds/tests run on Yggdrasil).

159
README.md
View file

@ -1,163 +1,24 @@
# Ymir
Ymir is the GameCult library and service boundary around a pinned Box3D
release, being cut over into Aetheria's authoritative embedded physics
substrate. The name means **Not Invented Here**. We are taking the hint.
Ymir is GameCult's 3D physics boundary around a pinned Box3D release (`extern/box3d`), consumed directly by `Lodur` and `BadDaySimulator`.
Box3D owns physics algorithms. Ymir owns the service boundary that makes those
algorithms usable as durable, typed GameCult world truth. Unity, renderers, and
game products consume Ymir state and contact facts; they do not become physics
authorities.
Box3D owns rigid-body integration, collision geometry, broadphase, joints, and contact solving. Ymir adds a C17 native SoA wrapper (`native/Ymir.Box3D`) with an embedded XPBD solid + SPH fluid particle solver (`ymir_particles.c`) and a managed `.NET 8` binding (`src/Ymir.Box3D`, package `GameCult.Ymir.Box3D`).
The production runtime path is a retained Box3D session. The parity facade
witnesses released behavior at the native boundary; Ymir adds stable ids,
typed commands and facts, replay memory, and deterministic projection without
installing a second solver.
## Entry Points
## Front Door
- **Value:** a retained Box3D physics session with GameCult world truth around it: stable entity ids, explicit mutation receipts, typed contact facts (Begin/Hit/End), replay-backed checkpoints, and deterministic result ordering.
- **Problem:** physics authority must not be split between Unity callbacks, gameplay geometry tests and a managed solver. Box3D decides physics, Ymir owns the service boundary, Aetheria supplies intent.
- **Entry points:**
- `src/Ymir.Core/YmirSession.cs`: the public in-process retained session (commands, receipts, stepping, queries, `CapturePersistence`). `YmirSimulator.cs` is the snapshot facade that wraps an isolated session.
- `src/Ymir.Box3D/` and `native/Ymir.Box3D/`: the native session ABI and the Ymir-owned Box3D shim (`GameCult.Ymir.Box3D` package).
- `tests/Ymir.Box3D.Parity/`: the executable parity contract against pinned Box3D v0.1.0 (`docs/box3d-parity.md`).
- `src/Ymir.Box3D/Box3DSoaWorld.cs` and `native/Ymir.Box3D/ymir_box3d_soa.c`: a headless 3D world (gravity, free rotation) whose state is a structure-of-arrays view read in place (`docs/soa-world.md`). Early slice for Lodur and Bad Day Simulator; spheres and static boxes only.
- `docs/architecture.md`, `docs/retained-session-contract.md`, `docs/aetheria-cutover.md`.
- Build and test: `git submodule update --init --recursive`, then `dotnet test Ymir.slnx` (needs CMake and a C17 compiler).
- **Live:** retained sessions, replay-backed checkpoint reconstruction, parity for overlap and cast queries, tractor membership, contact-begin facts, restitution, torque lifetime, collision filtering and bullet CCD. Aetheria embeds one session per run and zone and stores persistence in a daemon-private CultCache. Package version `0.3.0`.
- **Planned:** journal compaction, Linux and macOS package RIDs (built and smoked on their own workers), a committed release smoke for packaging, and the optional standalone daemon (`src/ymir-daemon` is a thin command host today and is never in Aetheria's gameplay path).
## Target Ownership
- Box3D owns rigid-body integration, collision geometry, broadphase, solver
behavior, continuous collision, overlap and cast semantics, contact
lifecycle, force and torque lifetime, tolerances, and deterministic step
behavior for identical recorded inputs.
- Ymir owns the pinned Box3D version, stable GameCult entity ids,
native ABI isolation, public in-process retained sessions, explicit mutation
receipts, typed contact facts, snapshot lowering, deterministic result
ordering, versioned CultCache snapshots.
- An optional Ymir daemon may own named session routing, durable command receipts,
checkpoint reconstruction, CultMesh command/fact publication, and process
supervision for worlds it hosts. It is not part of Aetheria's gameplay path.
- Aetheria owns gameplay policy and supplies typed physical intent: bodies,
fields, tractor targets, forces, projectiles, filters, and the gameplay
consequences of Ymir contact facts.
- CultMath remains available for GameCult-side numeric projections and force
preparation. It is not a second collision or integration engine.
- Unity and Eve lowerers render world state and submit commands. They never
repair, override, or independently simulate authoritative physics.
Box3D opaque handles are process-local derived state. They are never durable
entity ids and never cross the public contract boundary.
Ymir does not promise bit-identical continuation from an arbitrary mid-world
snapshot. Replay starts from canonical creation order plus the complete command
stream. Checkpoints may accelerate numeric state recovery within named
tolerances, but authoritative contact lifecycle facts resume only after that
canonical history has been replayed through the checkpoint tick.
## Aetheria Deployment Boundary
Aetheria embeds the Ymir library and native Box3D wrapper in its own daemon.
The Aetheria daemon owns gameplay ticks, world policy, player sessions,
commands, receipts, assets, and the Eve/CultMesh provider advertisement.
Generic Eve clients connect directly to Aetheria; they do not connect through
Ymir or a rendezvous service.
A future standalone Ymir daemon may expose the same physics contract for
tooling or other products. It is not an intermediary in Aetheria's gameplay
path and must never become a competing copy of Aetheria world truth.
## Current Cutover State
Box3D v0.1.0 is pinned at commit
`8441b4a06d6d09dcfb0b0f704df4d847d1437b92` plus the GameCult fork's two-commit
step-impulse observation (`docs/box3d-parity.md`). A Ymir-owned native shim and
parity suite already witness released Box3D behavior for:
- sphere overlap and shape casts
- tractor capsule membership and rounded caps
- numeric overlap and cast slop
- planar sphere-world stepping
- contact-begin facts
- restitution mixing
- transient torque lifetime
- category/mask/group collision filtering
- bullet CCD against kinematic bodies, including Box3D's next-step contact-event timing
The production `Ymir.Box3D` boundary owns the native session ABI. The legacy
snapshot `YmirSimulator.Step` contract now creates an isolated Box3D session,
projects the result, and disposes it. It contains no managed integrator,
collision loop, or impulse solver.
That snapshot facade deliberately does not pretend to own long-lived world
identity. The public in-process `YmirSession` now exposes explicit body
mutations, force and torque commands, revisioned receipts, retained stepping,
and typed Begin/Hit/End facts. It never treats omission as removal. Aetheria
embeds one session per run and zone; its old process-wide simulator objects
are not session identifiers. Revision-checked
retained-session circle overlap and cast queries observe the current stable-id
body projection without mutating it. Replay-backed checkpoint reconstruction is
implemented. `CapturePersistence` emits only the journal suffix not yet stored
by its host plus a bounded resume descriptor; restore verifies contiguous
chunks, the complete journal digest, the projected world, and active contact
episodes before the session can emit facts. Aetheria stores those records in a
daemon-private CultCache and uses its hard-flushed public frame as the commit
marker. Journal compaction and non-Windows RID artifacts remain cutover work.
See [the architecture map](docs/architecture.md) and
[the executable parity contract](docs/box3d-parity.md). The
[retained-session contract](docs/retained-session-contract.md) records the
current ownership cut shared by embedded and optional standalone hosts.
- `src/Ymir.Box3D/Box3DSoaWorld.cs`: managed 3D SoA world (`Box3DSoaWorld`, `Box3DSoaView`, `Box3DSoaFacts`) exposing contiguous body, joint, particle, constraint, wet-patch, and sensor lanes read in place.
- `native/Ymir.Box3D/ymir_box3d_soa.c` and `native/Ymir.Box3D/ymir_particles.c`: native SoA world (ABI 21) and PBD/SPH particle engine built into `ymir_box3d` (`ymir_box3d.dll` / `libymir_box3d.so` / `libymir_box3d.dylib`).
- `tests/Ymir.Box3D.Soa.Tests/`: xUnit verification suite covering rigid dynamics, joints, grabs, contact facts, impulses, removals, particles, cloth/rope coupling, fluids, wet patches, and sensors.
- `docs/soa-world.md`: SoA world contract, lane semantics, and measured bounds.
- `docs/box3d-parity.md`: pinned Box3D fork provenance (`extern/box3d`) and observed upstream behavior.
## Build And Test
Initialize the pinned dependency and run the solution:
Initialize the pinned Box3D submodule and build/test with CMake + a C17 compiler:
```powershell
git submodule update --init --recursive
dotnet test Ymir.slnx
```
The parity project builds the native shim from source and requires CMake plus a
C17 compiler:
```powershell
dotnet test tests\Ymir.Box3D.Parity\Ymir.Box3D.Parity.csproj
```
Box3D is MIT licensed. Its license is retained in `extern/box3d`.
`GameCult.Ymir.Box3D` packages the managed boundary, Box3D license, and native
facade under `runtimes/<rid>/native`. A local Windows x64 package has loaded in
an isolated empty consumer without CMake or the submodule. A committed release
smoke is still required before that is a repeatable packaging guarantee. Linux
and macOS packages must be produced and smoked on their own release workers
before those RIDs are advertised.
The current package version is `0.3.0`. ABI v5 exposes the exact pinned native
build identity plus Box3D body type,
bullet, field-participation, and collision-filter configuration without
exposing Box3D handles. These are Ymir contract fields, but their behavior is
Box3D behavior.
## Cutover Rule
A Ymir cutover is complete only when all runtime stepping, collision queries,
and contact facts come from Box3D through an explicitly owned Ymir session.
Manual Unity callbacks and Aetheria geometry tests must be structurally unable
to decide the result. Snapshot compatibility calls may use isolated sessions;
they are not allowed to infer or share retained-world identity.
## Building against CultLib
Builds are pinned to CultLib 2.0.0 (tag `cultlib-unity-v2.0.0`, revision `42dce3611a81adc5c5fac54cadbaa5637d6022d3`); the build fails if the CultLib checkout differs or is dirty. Create a pinned worktree and point the build at it:
```powershell
git -C <CultLib> worktree add --detach <path> cultlib-unity-v2.0.0
dotnet build -p:CultLibRoot=<path> # or set CULTLIB_ROOT=<path>
```
Without an override the sibling `..\CultLib` checkout is used and must itself be at that tag.
Box3D is MIT licensed; its license is retained in `extern/box3d/LICENSE` and packed in `GameCult.Ymir.Box3D`.

View file

@ -1,42 +0,0 @@
# Aetheria Cutover Notes
## First Slice
Cut over projectile travel and impact discovery before trying to replace every
Unity physics use.
1. Spawn a Ymir body for each projectile and relevant target hull/contact shape.
2. Step Ymir on the same fixed tick used by Aetheria gameplay.
3. Render Unity projectile GameObjects from Ymir snapshots.
4. Convert Ymir contacts into Aetheria hit/splash policy.
5. Keep Unity colliders as visual/debug witnesses only during the transition.
6. Delete or neuter collider callbacks once the Ymir path owns hit truth.
## Negative Checks
- A projectile with a Unity collider disabled still travels and hits through
Ymir.
- A Unity `OnCollisionEnter` callback cannot apply damage independently.
- Replaying from the same canonical creation order and command stream under the
accepted Box3D build produces the same ordered Ymir facts.
- Restarting from a checkpoint matches named numeric state tolerances. It emits
no authoritative gameplay contact facts until canonical history has replayed
through the checkpoint tick and restored exact contact lifecycle identity.
- Mid-flight visible projectile position matches the Ymir snapshot within a
named tolerance.
## Adapter Boundary
Unity adapter code may:
- submit spawn/despawn/field/body commands
- receive snapshots and contacts
- render GameObjects from snapshots
- publish diagnostics
Unity adapter code may not:
- alter positions as a hidden repair loop
- apply gameplay damage from Unity collisions
- maintain a parallel physics cache that can override Ymir
- treat scene hierarchy as the source of simulation truth

View file

@ -1,237 +0,0 @@
# Ymir Architecture
## Objective
Expose Box3D as authoritative, typed, persistent GameCult physics without
leaking an alpha native API into products, clients, or durable state.
Ymir's target is a stable embedded wrapper around retained Box3D worlds, not an
independent physics-engine research project. Box3D supplies the physics mind.
Ymir supplies the memory, nerves, names, and session boundary. The same
boundary may optionally be hosted as a standalone daemon.
## Target Owner
A long-lived Box3D `b3World` owns the physical decision: given the current
world plus commands for a fixed step, what transforms, velocities, overlaps,
casts, and contact transitions are true.
Ymir owns the enclosing session and contract:
- pin and build the accepted Box3D release;
- map stable GameCult ids to transient Box3D handles;
- accept typed body, shape, filter, force, torque, field, query, and step
commands;
- project Box3D outputs into typed, deterministically ordered Ymir facts;
- reconstruct sessions from CultCache checkpoints;
- return typed state, contacts, queries, and receipts to an embedding product;
- when running standalone, publish Ymir's own physics provider and operator
surfaces through CultMesh;
- supervise world lifetime, failure, replay, and observability.
## Deployment Boundary
For Aetheria, Ymir is an embedded library. Aetheria owns the outer daemon,
gameplay session, fixed tick, product commands and receipts, asset catalog, and
advertised Eve/CultMesh surface. Generic Eve clients connect directly to the
Aetheria daemon. They never import Ymir internals and do not route gameplay
through a standalone Ymir or discovery service.
A standalone Ymir daemon is an optional hosting mode for physics tooling and
other products. It hosts the same Ymir session primitive; it is not an
Aetheria relay and cannot own a shadow copy of Aetheria's world.
## Current Body
The runtime solver cut is complete: Box3D is the only integrator, collision
engine, broadphase, query-geometry implementation, and contact source in the
committed Ymir path. The public `YmirSimulator.Step` compatibility API creates
an isolated internal session for one complete snapshot, projects its output,
and disposes it. Public circle overlap and cast APIs invoke Box3D geometry over
caller-supplied bodies.
The retained native session now has a public in-process `YmirSession` port with
explicit spawn, remove, teleport, velocity, configuration, force, torque,
step, and disposal operations. It emits revisioned receipts and typed
Begin/Hit/End facts with stable Ymir identities. Ordinary retained steps do not
accept complete body snapshots.
The embedded retained-session library has replay-backed reconstruction,
durable command receipts, incremental journal-suffix capture, and bounded
resume descriptors. Aetheria stores these in a second daemon-private CultCache:
immutable chunks are flushed first, immutable per-frame resumes second, and the
public Aetheria frame last. The public frame is the only commit marker. Orphaned
private records cannot advance gameplay truth, and restart fails closed once
the persistence capability has been activated. Complete replay history is not
product state and never rides in public client frames. The current CLI still
has no named session registry or CultMesh command lowerings; its CultCache
output remains a regenerated diagnostic projection.
## Target Inputs
- stable body and shape definitions
- fixed time step and explicit substep count
- transient forces, torques, impulses, and target transforms
- collision filters and material definitions
- overlap, ray, and shape-cast queries
- product-owned selections such as which pickup ids a tractor may affect
Aetheria chooses physical intent and gameplay eligibility. Box3D decides
geometry membership and contact. Ymir carries the typed handoff.
## Target Outputs
- body transforms and linear/angular velocities
- begin, end, and hit contact facts with stable Ymir ids
- overlap and cast results sorted by distance and stable id
- step receipts and replay/checkpoint provenance
- provider-owned operator and debug projections
Box3D callback order is not a public contract. Ymir may sort facts, but it may
not alter their membership or invent missing contacts.
## Derived State
- Box3D world, body, shape, contact, and joint handles are transient session
state derived from stable Ymir definitions.
- CultCache checkpoints are reconstruction inputs and publication records; they
are not a second live solver.
- SoA body documents are transport and inspection projections over the live
session.
- Unity GameObjects and Electron objects are render state only.
- Aetheria damage, loot, capacity, faction, and scoring consequences are
derived from Ymir facts plus Aetheria policy.
## Dimensional Compatibility
The fossil Aetheria simulation uses a two-dimensional gameplay plane. During
cutover, Ymir maps that plane into Box3D X/Z with translation on Y locked and
rotation constrained to the plane normal. This is an explicit compatibility
projection. It does not make Ymir a second 2D physics engine.
Sphere friction and inertia are not identical to planar disk behavior. Any
mechanic that depends on that difference must be witnessed against the fossil
and then expressed through Box3D configuration, not repaired by a parallel
solver.
## Forbidden Writers
- managed integration, impulse resolution, collision geometry, or broadphase
code in Ymir;
- persisted force or torque replayed as if it were continuing authority;
- Aetheria rectangle, capsule, overlap, or contact tests deciding gameplay
physics;
- Unity collision callbacks deciding hits, destruction, or pickup collection;
- renderer transforms pushing hidden corrections into the world;
- transport endpoints or dashboards owning world state;
- Box3D opaque ids stored as durable GameCult identity.
## Target Shared Paths
Direct player commands, agent commands, programmatic spawns, server ticks,
imports, reconnects, replay, and checkpoint recovery will enter the same Ymir
session primitive for their named world. Today, DTO compatibility methods
lower into an isolated Box3D session; they may not run an alternate step or
infer retained identity from a body list.
Session identity must be explicit. A process-wide simulator object, zone index,
or repeated stable body id is not enough to join two calls to the same world.
Aetheria owns run and zone lifetime and creates, retains, and disposes the
corresponding embedded Ymir session. Projectile sweep
and stationary mine proximity integration can use Ymir's revision-checked
retained-session circle-cast and overlap queries. They observe the current
stable-id body projection; they do not invent a contact episode or mutate the
Box3D world.
Radial gravity and tractor attraction are typed force-generation inputs. They
are applied to Box3D before stepping. Pickup collection remains an Aetheria
transaction triggered exactly once by a Ymir/Box3D contact fact.
## Native Boundary
`extern/box3d` pins the accepted upstream source. `native/Ymir.Box3D` owns a
small stable C ABI facade. Managed Ymir code binds only to that facade; it does
not scatter hundreds of direct P/Invokes across the daemon.
The native facade must remain boring:
- caller-owned blittable buffers;
- explicit version and precision facts;
- no GameCult gameplay policy;
- no JSON state boundary;
- no public exposure of Box3D internal handles;
- first-class RID packaging before production consumers depend on it.
## Target Persistence Contract
Canonical deterministic replay starts from the same initial definitions and
creation order, then applies the complete command stream under the pinned
Box3D build and accepted runtime configuration.
A checkpoint restart is a different promise. Its schema must contain enough
typed definitions and state to reconstruct an equivalent Box3D world: stable
ids, 3D transforms, linear and angular velocity,
body/shape/material/filter definitions, session tuning, and provenance. Box3D
does not expose every internal solver cache, so arbitrary mid-world checkpoint
restart is tested against named numeric state tolerances rather than claimed as
bit-identical continuation. Contact membership, ordering, and exactly-once
lifecycle identity are binary contracts, not tolerance checks. Authoritative
contact facts resume only after canonical history has been replayed through the
checkpoint tick; a checkpoint alone cannot emit gameplay contact facts.
`gamecult.ymir.session_checkpoint.replay.v1` implements that promise. It stores
the initial definitions, complete typed command journal, logical session
generation, command digest, body-generation counter, world verification
projection, active contact-episode verification records, and pinned runtime
fingerprint. Restore replays into a new Box3D world with outward publication
suppressed, then compares the reconstructed boundary exactly before returning a
live session. The bounded binary codec rejects incompatible, corrupt, or
trailing data and checksums the complete encoded payload. ABI v5 validates the
exact pinned native build id, not merely Box3D's public version. Native Box3D
identities never enter the checkpoint.
`gamecult.ymir.world_state.v2` appends Box3D body type, bullet,
field-participation, and collision filter arrays to the v1 layout. The v1 and
v0 readers are explicit migration paths; keys are not reassigned. Torque is
transient command state and is intentionally absent. Version 2 is a
compatibility world snapshot, not a complete retained-session
checkpoint: it does not preserve full shape, material, filter, session tuning,
provenance, or warm contact state.
Transient forces and torques are commands, not durable body state. Derived
mass and inertia are published only when useful for inspection. Old checkpoint
versions must migrate explicitly or fail closed; they may not silently decode
under a reassigned MessagePack layout.
## Cut Line
The managed integrator and circle impulse solver have been deleted from the
runtime path. Any uncommitted `YmirQueryPrimitives` or `YmirSpatialIndex` work
is obsolete and must not be annexed. The retained-session cut continues until
Box3D-backed sessions prove:
1. fixed-step body state projection;
2. begin/end/hit contact lifecycle;
3. overlap and shape-cast lowering;
4. continuous collision event timing and same-step Box3D cast witnesses;
5. transient force and torque application;
6. checkpoint reconstruction and replay (implemented; journal compaction and
long-running storage remain operational work);
7. Aetheria gravity, tractor, pickup, and payload smokes.
There is no managed fallback after that cut. A native load or compatibility
failure fails closed and reports the missing capability.
## Required Verification
- Box3D parity tests record released upstream law at the native boundary.
- Ymir differential tests compare public projections with the same Box3D
session facts.
- Negative source checks prove custom solver and spatial-index authorities are
absent after cutover.
- Aetheria smokes prove gravity, tractor attraction, contact-gated pickup
collection/rejection, physical payload hits, and restart continuation through
the retained contract. Destruction loot remains Aetheria gameplay state
gated by Ymir contact facts where collection occurs.
- Released-client witnesses prove generic Eve clients only observe Ymir and
Aetheria provider contracts, never native implementation details.

View file

@ -1,87 +1,15 @@
# Box3D Parity Harness
# Pinned Box3D Fork Notes
## Authority
Box3D v0.1.0 is Ymir's physics implementation and executable semantics oracle.
The production native session ABI and snapshot lowering are live; explicit
retained-world ownership is still being connected. The exact upstream source is pinned as the
`extern/box3d` submodule at the GameCult fork's commit
`c790839` (`https://eureka.gamecult.org/forge/GameCult/box3d`, branch `gamecult/destroy-enlarged-proxy`).
The fork is upstream `8441b4a06d6d09dcfb0b0f704df4d847d1437b92` plus these commits: an observed field,
`b3ManifoldPoint.stepNormalImpulse`, the normal impulse each contact point applied over the whole step; a
static assert that `RELAX_ITERATIONS` is 1, the one setting under which that sum is exact; and a substep callback
(`b3World_SetSubStepCallback`, with `b3Body_GetSubStepState` and `b3Body_ApplySubStepImpulse`, valid only inside it)
that the particle phase runs in, after the biased solve and before positions integrate. The first two change no solver
arithmetic and a world with no callback registered runs exactly as before, so dynamics are bit-identical to upstream
(the six ABI 8 hashes pin it). Then the contact friction hook (`ebe346a`, see `soa-world.md`), and a broad-phase
fix: a proxy destroyed after its step enlarged it, while it was the only buffered move, left its tree ancestors flagged
enlarged and the empty move buffer skipped the rebuild that clears them, so Debug validation aborted the next step;
the empty-buffer path now rebuilds (a root walk on a clean tree; the fork's `DestroyEnlargedProxyTest`). To rebase it onto a newer Box3D, re-apply those commits, re-run the Soa impulse and
particle tests and compare a pile's state hash against the upstream build.
Box3D v0.1.0 is Ymir's rigid-body physics implementation (`extern/box3d` submodule), pinned at the GameCult fork commit `c790839` (`https://eureka.gamecult.org/forge/GameCult/box3d`, branch `gamecult/destroy-enlarged-proxy`).
Box3D does not own GameCult entity ids, gameplay policy, persistence, or result
ordering. Ymir projects Box3D facts into those contracts. Box3D owns
shape overlap, shape cast, solver, broadphase, contact lifecycle, force and
torque lifetime, and numeric tolerances.
The fork is upstream `8441b4a06d6d09dcfb0b0f704df4d847d1437b92` plus:
- `b3ManifoldPoint.stepNormalImpulse`: observed field recording the normal impulse each contact point applied over the whole step, with a static assert that `RELAX_ITERATIONS` is 1 so the sum is exact.
- Substep callback (`b3World_SetSubStepCallback`, with `b3Body_GetSubStepState` and `b3Body_ApplySubStepImpulse`, valid only inside the callback) used by the particle phase (`ymir_particles.c`) after the biased solve and before positions integrate.
- Contact friction hook (`ebe346a`, see `docs/soa-world.md`).
- Broad-phase fix (`DestroyEnlargedProxyTest`): rebuilding when the move buffer is empty clears stale enlarged flags on tree ancestors after proxy destruction.
## Body
To rebase onto a newer Box3D, re-apply those commits, re-run `tests/Ymir.Box3D.Soa.Tests`, and compare pile state hashes against the upstream build.
`native/Ymir.Box3D` statically links the pinned C17 library into one small
shared-library facade. The facade exports retained sphere-world sessions plus
the overlap, cast, pair-step, torque-lifetime, version, and ABI-layout
operations used by the harness. This keeps Box3D's alpha C ABI out of Ymir's
public managed contracts.
Production ABI version 5 uses caller-owned blittable buffers, explicit cdecl,
fixed-width status/count values, compile-time C layout assertions, and a
managed/native layout and pinned-build-identity sentinel before opening a session. It adds explicit
retained body mutations, one-shot force and torque operations, and a
session-owned Begin/Hit/End event buffer. The private buffer retains Box3D's
stored contact key only long enough to correlate its separate event arrays;
public Ymir facts never expose native contact identity. Planar direction maps to Box3D
rotation about Y; angular velocity and transient torque remain Box3D state and
commands rather than managed integration.
ABI v5 additionally carries Box3D static/kinematic/dynamic selection, bullet
CCD, category/mask/group filtering, and per-body radial-field participation.
`tests/Ymir.Box3D.Parity` builds that facade through CMake and invokes it with
source-generated .NET interop. Run it with:
```powershell
dotnet test tests\Ymir.Box3D.Parity\Ymir.Box3D.Parity.csproj
```
The build requires CMake and a C17 compiler. Box3D is MIT licensed; its license
is retained in the pinned submodule.
## Released v0.1.0 Law
- Sphere overlap accepts separation strictly below the `0.0005 m` overlap
slop. Exact tangency therefore overlaps.
- Sphere shape casts use Box3D's `0.005 m` linear slop. The hit fraction is not
the zero-tolerance analytic sphere intersection.
- The low-level v0.1.0 sphere shape cast reports initially touching and
initially overlapping shapes as hits. The harness records the released
binary's behavior rather than relying on prose or recollection.
- A two-point shape proxy plus radius is the tractor capsule. Membership
includes rounded start and end caps and the same overlap slop.
- Box3D query callback order is not a contract. Ymir sorts projected results by
distance and stable entity id.
- Contact begin facts are emitted after the world step.
- Restitution uses the maximum of the two shape materials.
- Applied torque is transient and cleared by each world step; a continuous
torque must be submitted again for the next step.
- A negative Box3D group index suppresses collision within that group before
category/mask evaluation. Category and mask bits then decide eligible pairs.
- Bullet CCD against a kinematic target prevents traversal during the fast
step, but Box3D v0.1.0 emits the typed contact event on the following step.
Same-step gameplay triggering therefore requires an explicit Box3D shape
cast; Ymir must not invent an earlier Begin event.
## Cut Line
The managed integrator and circle collision solver are no longer runtime
authorities. The remaining parity slice covers explicit retained-world
ownership, end-contact lifecycle, continuous collision, and replay. Custom
query geometry and spatial indexes are not fallback authorities; Box3D owns
those edge cases.
Box3D is MIT licensed; its license is retained in `extern/box3d/LICENSE`.

View file

@ -1,203 +0,0 @@
# Retained Session Contract
## Objective
One named Ymir session owns one retained Box3D world. A product may restore the
world once, issue explicit mutations, step it, query it, and consume typed
Box3D contact facts. A body snapshot is output and checkpoint material; it is
not an implicit command language.
## Current Mechanism
`YmirSimulator` is an isolated snapshot compatibility API. It creates a native
session, synchronizes a complete body list, steps once, projects the result,
and disposes the session. Its private compatibility helper uses that complete
list, so omission can delete a body and stale input can teleport or overwrite
solver velocity inside the isolated call. Its legacy contact output merges
current manifolds, begin events, and hit events into one pair-deduplicated list
and omits End.
The public `YmirSession` does not use that mechanism for ordinary retained
steps. The compatibility path is not the retained session contract.
## Owner
- One public Ymir session serializes commands for one named world.
- Its native Box3D `b3World` exclusively owns integration, collision,
broadphase, queries, solver state, and contact lifecycle.
- Ymir owns stable GameCult ids, body generations, session revision, step
sequence, deterministic projection, fact identity, and command receipts.
- The product owns session lifetime and gameplay policy. Aetheria maps one
`(RunId, ZoneIndex)` lifetime to one Ymir session.
## Target Inputs
The retained port accepts narrow operations with explicit meaning:
- spawn a body, rejecting an existing id;
- remove a body, rejecting an unknown id;
- teleport a body;
- set linear and angular velocity;
- configure body shape, mass, static/kinematic/dynamic type, and restitution;
- apply one-shot force or torque;
- step with a fixed delta, substep count, and typed fields;
- dispose the session.
The current public slice implements those mutation and step operations plus
revision-checked circle overlap and cast queries. A query observes the current
retained body projection under the session lock and accepts an explicit set of
stable candidate body ids. The candidate set is product-owned eligibility;
Box3D still owns the overlap/cast geometry and numeric result.
Bullet, collision-filter, and field-participation profiles are currently
spawn/restore definitions. Retained `Configure` changes radius, mass,
static/kinematic/dynamic type, and restitution only. Changing the profile
requires explicit remove-and-spawn until a typed profile command exists.
Restore/import is the only path allowed to accept a complete world snapshot.
There is no `Upsert`, generic patch bag, or omission-based removal.
## Outputs
Each accepted mutation produces a receipt that names the session generation,
command id, before revision, and after revision. A step additionally returns:
- authoritative Box3D body state;
- the new step index;
- typed `Begin`, `Hit`, and `End` facts;
- stable fact ids and contact-episode ids;
- the accepted step configuration through its typed command.
The current library validates the native Box3D version and ABI before session
creation but does not repeat those facts in every Step result.
Facts canonicalize bodies by stable id and flip normals when canonicalization
swaps endpoints. Their public order is body pair, contact episode, kind, then
within-kind ordinal. This is stable publication order, not invented substep
chronology.
## Derived State
- Box3D handles are process-local and never cross the contract.
- DTO and SoA body arrays are projections.
- `gamecult.ymir.world_state.v2` is an inspection/migration snapshot, not a
retained-session checkpoint.
- Receipt and contact-episode ledgers are session metadata, not physics law.
- Aetheria cargo, damage, loot, feedback, and scoring remain gameplay state
derived from Ymir facts.
The replay checkpoint preserves the logical session generation, complete typed
command journal, receipt ledger, body-generation counter, world projection, and
active contact episodes. Restore creates a fresh native Box3D world and replays
that journal through the checkpoint boundary before facts may leave the
session. The world and episode records verify replay; they do not replace it or
infer contact continuity from body proximity.
`gamecult.ymir.session_checkpoint.replay.v1` is encoded by the bounded binary
`YmirSessionCheckpointCodec`. The checkpoint carries the pinned Box3D/ABI/
precision fingerprint and fails closed on incompatible provenance, corrupt or
trailing data, journal divergence, world divergence, or contact-lineage
divergence. A SHA-256 checksum binds session identity, provenance, journal,
world verifier, and active episodes. ABI v5 independently validates the exact
pinned native build id before opening a session. It contains no native Box3D
handle or contact key.
For incremental host persistence,
`gamecult.ymir.session_journal_chunk.v1` carries a contiguous command-journal
suffix and `gamecult.ymir.session_resume.v1` carries the bounded reconstruction
boundary. `CapturePersistence(persistedJournalEntryCount)` never repeats an
already acknowledged prefix. Restore orders chunks by their first entry,
requires exact coverage from zero through the descriptor count, and then uses
the same full replay and verifier path as a complete checkpoint. Both binary
forms are independently checksummed.
The cursor is an index within one session generation. Bounded persistence uses
an explicit generation rollover, never an inferred acknowledgement side effect.
`TryCreateCompactedPersistenceBaseline` may create a replacement session only
when the current journal is empty or ends in an accepted Step and Box3D reports
no active contact episodes. The replacement starts from the current body
projection and time with a fresh session generation, revision zero, an empty
receipt ledger, and an empty journal. The host atomically swaps ownership and
then disposes the prior session.
Active contacts, pending forces, or other unstepped mutations refuse rollover.
Those sessions retain replay reconstruction until a later quiescent boundary.
Ymir does not synthesize contact closure, serialize private Box3D handles, or
pretend a body snapshot can preserve solver contact state. Old generation
journals become audit history after the host commits the replacement boundary;
they are not inputs to the new generation's restore.
## Forbidden Writers
- recurring complete-body synchronization after restore;
- snapshot omission as body removal;
- transform or velocity setters hidden inside ordinary Step;
- managed contact lifecycle inference that replaces Box3D events;
- random fact ids or ids derived from manifold floats;
- Box3D callback order exposed as a public ordering guarantee;
- Unity callbacks, renderer state, or gameplay proximity checks deciding
contact truth.
## Shared Paths
Direct commands, agent commands, spawns, and checkpoint replay use the same
explicit session operations. Restore establishes a fresh native world through
those operations; it is not a parallel state writer.
Retained queries will observe a named revision without mutating it. Snapshot
reads cannot be fed back without an explicit restore, teleport, velocity, or
configuration operation.
## Contact Identity
A contact episode is identified by the canonical pair of body id plus body
generation and a monotonically assigned episode number. Begin and End share
that identity. A later re-contact creates a new episode. Fact identity derives
from session generation, step index, contact episode, kind, and deterministic
ordinal. Box3D contact and shape handles are never durable identity.
Body removal must close any active episode exactly once. Because Box3D End
events may reference destroyed shapes, the native boundary retains stable ids
until the event buffer has been drained.
Box3D publishes Begin, Hit, and End in separate arrays rather than one causal
sequence. The private ABI carries Box3D's stored transient contact key so Ymir
can correlate those arrays before assigning public episode identity. That key
is derived process state: it never appears in a public fact or checkpoint.
## Cut Line
1. Typed native mutation operations and step-owned lifecycle buffers: done.
2. Public managed retained session with no ordinary full synchronization:
done.
3. Revision-checked retained-session overlap and cast queries: done.
4. One embedded retained world and physical-payload session per Aetheria run
and zone: done.
5. Incremental journal chunks and bounded resume descriptors: done. Aetheria
stores them in a daemon-private CultCache; complete history does not ride in
public product frames. Quiescent generation rollover provides the compaction
primitive; host adoption and old-generation retention policy are separate.
6. For optional standalone hosting, add a session registry, generation-bearing
routed commands, idempotent Create, durable receipts, and CultMesh lowering.
The isolated `YmirSimulator` remains a compatibility API. It is never the
retained-world authority.
Mutation-generated End evidence is currently retained in the native pending
buffer and published by the next accepted Step. The host transaction cut
must make mutation plus Step one publication boundary, or return mutation facts
directly, before Ymir promises that removal followed by disposal publishes an
End fact.
## Verification
- A spawned body advances across steps without being resubmitted.
- Omission from unrelated commands cannot remove or reset a body.
- Force and torque affect exactly one accepted step.
- stale revisions and conflicting command ids cannot mutate the world.
- persistent touching emits one Begin, separation emits one End, and re-contact
creates a new episode.
- duplicate fact delivery cannot commit Aetheria cargo twice.
- different insertion orders produce the same semantic fact order.
- queries observe the requested retained revision and cannot inject bodies.
- disposed or stale session generations fail closed.
- restored continuation reproduces command receipts, bodies, active contact
identity, and subsequent Begin/End facts before authoritative publication.

View file

@ -1,14 +1,7 @@
# Headless SoA world
A headless 3D Box3D world with a structure-of-arrays state view, for Lodur and Bad Day Simulator.
Box3D decides every physical outcome; Ymir creates bodies, steps the world and exposes state.
## Why it is not the retained session
`ymir_box3d_session_*` (`ymir_box3d.c`) is the planar Aetheria session: gravity is zero, Y is locked,
only yaw rotates (`motionLocks.linearY/angularX/angularZ`), and state leaves by `copy_bodies` into an
array of structs. A body cannot fall or tumble there, and every read is a copy. The SoA world is a
separate native object (`ymir_box3d_soa.c`, ABI 21) so the Aetheria session's contract is untouched.
Box3D decides every physical outcome; Ymir creates bodies, steps the world and exposes state (`ymir_box3d_soa.c`, ABI 21).
## Contract
@ -320,7 +313,7 @@ no allocation across 100 steps with fact reads. `Box3DSoaImpulseTests`: `contact
Compound bodies
and per-shape material, and motor joints with a velocity target (the motor joint here is a position spring only; Lodur drives limbs from torque lanes). A one-call cascading `remove_body` that also removes the attachments and sensors naming the body is not built: the caller removes them first.
`Ymir.Core` has no session-level surface over the SoA world yet; consumers use `Ymir.Box3D` directly.
Consumers use `Ymir.Box3D` (`Box3DSoaWorld`) directly.
Unity consumption is unrun; cross-platform bit-identity is unclaimed.
Particles: a sheet pinned at few points sieves at 4 substeps (the pour stretches a corner-pinned 16 x 16 sheet 38% and a same-size particle passes it, a same-mass solid block worse; per-substep travel is about 1 cm against a 4 cm contact, so it is the sheet and the contact solver, not the fluid: a loose-cloth limit, ruling ymir-sheet-sieve-at-budget-substeps); a sheet attached along its length to a body holds (`Skin_on_a_bone_holds_under_pour_and_drop`: 30 skin particles on a capsule under a 343-particle pour or 64 dropped solids, 3 s at 4 substeps and 60 or 120 Hz, worst edge stretch 0.021, no load particle inside the bone, skin place held to float noise), so BDS skin needs no more substeps, no boundary density for rigid bodies (a Box3D body adds nothing to a fluid particle's density estimate, so fluid
@ -351,9 +344,7 @@ Determinism under MSVC's
`bin\$(Configuration)\` on every platform: `CMakeLists.txt` writes `bin/$<CONFIG>/` and the csproj passes `-DCMAKE_BUILD_TYPE=$(Configuration)`, so single- and multi-config generators land in the same place.
- Windows run: MinGW gcc with `CMAKE_GENERATOR="Ninja Multi-Config" CC=gcc`; `Ymir.Box3D.Soa.Tests` passes.
Linux run (Yggdrasil, default generator, gcc): the same tests pass and emit `bin/Debug/libymir_box3d.so`. macOS is unrun.
- Threading: creating and destroying worlds is safe from any number of threads at once (a process-wide lock in the native
layer serializes `b3CreateWorld`/`b3DestroyWorld`, which otherwise scan and rewrite Box3D's global world pool unsynchronized;
the retained session and pair-step paths take the same lock). Stepping distinct worlds concurrently is not known to race: Box3D's own docs promise no thread safety, and this rests on a reading of the pinned source and one light test. A single world
- Threading: creating and destroying worlds is safe from any number of threads at once (a process-wide lock in `ymir_box3d_soa.c` serializes `b3CreateWorld`/`b3DestroyWorld`, which otherwise scan and rewrite Box3D's global world pool unsynchronized). Stepping distinct worlds concurrently is not known to race: Box3D's own docs promise no thread safety, and this rests on a reading of the pinned source and one light test. A single world
is still not thread-safe. `Box3DSoaConcurrentCreateTests` creates, steps and disposes worlds from eight threads.
- At most 128 live worlds per process (Box3D's `B3_MAX_WORLDS`); creating more trips a Box3D assert, not a managed error.
- `Box3DSoaWorld` is not thread-safe: `Dispose` must not race `Step` or a lane read. A `Box3DSoaView` refuses

View file

@ -1,13 +1,7 @@
# GameCult.Ymir.Box3D
This is Ymir's private managed/native boundary for pinned Box3D v0.1.0. It is
installed transitively by Ymir; products and clients should reference Ymir's
typed session contracts instead of this package.
Managed and native 3D SoA rigid-body + PBD/SPH particle boundary around pinned Box3D (`extern/box3d`), consumed by `Lodur` and `BadDaySimulator`.
The package includes the compiled native facade under `runtimes/<rid>/native`.
Package consumers do not need CMake, a C compiler, or the Box3D submodule.
Missing or ABI-incompatible native assets fail closed when Ymir opens a physics
session.
The NuGet package bundles the compiled native library under `runtimes/<rid>/native`, so package consumers do not need CMake, a C compiler, or the Box3D submodule. Source builds use CMake to compile `native/Ymir.Box3D` (`ymir_box3d_soa.c`, `ymir_particles.c`, and `extern/box3d`).
Source builds of Ymir use CMake to compile the pinned submodule. Box3D is MIT
licensed; its license is included in the package.
Box3D is MIT licensed; its license is included in the package.

View file

@ -1,108 +0,0 @@
param(
[Parameter(Mandatory=$true)]
[string]$Summary,
[string]$Claim,
[string]$Question,
[Parameter(Mandatory=$true)]
[string]$Tension,
[Parameter(Mandatory=$true)]
[string]$ActionImplication,
[string[]]$Tags = @("ymir", "repo-persona"),
[string]$Kind = "project_seam",
[string]$TargetKind = "repo",
[string]$TargetId = "Ymir",
[string]$TargetLabel = "Ymir",
[string]$AnchorRef = "repo:Ymir",
[string]$AnchorKind = "repo",
[string]$AnchorSummary = "Ymir repository Persona state",
[string]$StatePath = ".\.voidbot\state\ymir.cc"
)
$ErrorActionPreference = "Stop"
if ([string]::IsNullOrWhiteSpace($Claim) -and [string]::IsNullOrWhiteSpace($Question)) {
throw "Memory writes must include either -Claim or -Question."
}
$repoRoot = Resolve-Path (Join-Path $PSScriptRoot "..")
$voidBotRoot = "E:\Projects\VoidBot"
$coreDistPath = Join-Path $voidBotRoot "packages\core\dist\index.js"
$identityPath = Join-Path $repoRoot ".voidbot\voice\identity.json"
$resolvedStatePath = $ExecutionContext.SessionState.Path.GetUnresolvedProviderPathFromPSPath((Join-Path $repoRoot $StatePath))
if (!(Test-Path $coreDistPath)) {
throw "Missing VoidBot built core at $coreDistPath. Build VoidBot before mutating Persona state."
}
$now = (Get-Date).ToUniversalTime().ToString("o")
$memoryId = "ymir-" + ([guid]::NewGuid().ToString())
$operation = @{
operation = "record_short_term_memory"
memory = @{
memoryId = $memoryId
kind = $Kind
target = @{
kind = $TargetKind
id = $TargetId
label = $TargetLabel
}
summary = $Summary
createdAt = $now
updatedAt = $now
tags = $Tags
anchorRefs = @(
@{
ref = $AnchorRef
kind = $AnchorKind
summary = $AnchorSummary
}
)
evidenceRefs = @()
}
}
foreach ($field in @("Claim", "Question", "Tension", "ActionImplication")) {
$value = Get-Variable -Name $field -ValueOnly
if (![string]::IsNullOrWhiteSpace($value)) {
$operation.memory[$field.Substring(0, 1).ToLowerInvariant() + $field.Substring(1)] = $value
}
}
$operationJson = $operation | ConvertTo-Json -Depth 12 -Compress
$operationJsonBase64 = [Convert]::ToBase64String([System.Text.Encoding]::UTF8.GetBytes($operationJson))
node -e @"
const core = require(process.argv[1]);
const fs = require('fs');
const identity = JSON.parse(fs.readFileSync(process.argv[2], 'utf8'));
const statePath = process.argv[3];
const operation = JSON.parse(Buffer.from(process.argv[4], 'base64').toString('utf8'));
(async () => {
await core.ensureVoidSelfStateIdentityProfile({
canonicalPath: statePath,
identity: {
agentId: identity.id,
publicName: identity.displayName,
publicDescription: identity.description
}
});
const result = await core.applyVoidSelfStateOperation({
canonicalPath: statePath,
identity: {
agentId: identity.id,
publicName: identity.displayName,
publicDescription: identity.description
}
}, operation);
console.log(JSON.stringify({ ok: true, memoryId: operation.memory.memoryId, result }, null, 2));
})().catch((error) => {
console.error(error);
process.exit(1);
});
"@ $coreDistPath $identityPath $resolvedStatePath $operationJsonBase64
if ($LASTEXITCODE -ne 0) {
exit $LASTEXITCODE
}

View file

@ -1,44 +0,0 @@
param(
[string]$StatePath = ".\.voidbot\state\ymir.cc",
[switch]$Json
)
$ErrorActionPreference = "Stop"
$repoRoot = Resolve-Path (Join-Path $PSScriptRoot "..")
$voidBotRoot = "E:\Projects\VoidBot"
$coreDistPath = Join-Path $voidBotRoot "packages\core\dist\index.js"
$identityPath = Join-Path $repoRoot ".voidbot\voice\identity.json"
$resolvedStatePath = $ExecutionContext.SessionState.Path.GetUnresolvedProviderPathFromPSPath((Join-Path $repoRoot $StatePath))
if (!(Test-Path $coreDistPath)) {
throw "Missing VoidBot built core at $coreDistPath. Build VoidBot before reading Persona state."
}
node -e @"
const core = require(process.argv[1]);
const fs = require('fs');
const identity = JSON.parse(fs.readFileSync(process.argv[2], 'utf8'));
const statePath = process.argv[3];
core.loadVoidSelfStateTypedDocuments({
canonicalPath: statePath,
identity: {
agentId: identity.id,
publicName: identity.displayName,
publicDescription: identity.description
}
}).then((state) => {
if (process.argv[4] === '--json') {
console.log(JSON.stringify(state, null, 2));
return;
}
console.log(core.renderVoidSelfStateSummary(state));
}).catch((error) => {
console.error(error);
process.exit(1);
});
"@ $coreDistPath $identityPath $resolvedStatePath $(if ($Json) { "--json" } else { "" })
if ($LASTEXITCODE -ne 0) {
exit $LASTEXITCODE
}

View file

@ -1,60 +0,0 @@
param(
[string] $AetheriaRoot = (Resolve-Path (Join-Path $PSScriptRoot "..\..\Aetheria")).Path
)
$ErrorActionPreference = "Stop"
function Read-Text([string] $relativePath) {
$path = Join-Path $AetheriaRoot $relativePath
if (-not (Test-Path -LiteralPath $path)) {
throw "Required Aetheria file is missing: $relativePath"
}
Get-Content -Raw -LiteralPath $path
}
function Assert-Contains([string] $text, [string] $needle, [string] $message) {
if (-not $text.Contains($needle)) {
throw $message
}
}
function Assert-NotContains([string] $text, [string] $needle, [string] $message) {
if ($text.Contains($needle)) {
throw $message
}
}
if (-not (Test-Path -LiteralPath $AetheriaRoot)) {
throw "Aetheria root does not exist: $AetheriaRoot"
}
$shieldManager = Read-Text "Assets\Scripts\Gameplay\ShieldManager.cs"
$hullCollider = Read-Text "Assets\Scripts\Gameplay\HullCollider.cs"
$projectile = Read-Text "Assets\Scripts\Gameplay\Weapons\Projectile.cs"
$bridge = Read-Text "Assets\Scripts\Gameplay\Physics\AetheriaYmirPhysicsBridge.cs"
Assert-NotContains $shieldManager "OnCollisionEnter" "ShieldManager must not decide gameplay from Unity collision callbacks."
Assert-NotContains $shieldManager "TakeHit(" "ShieldManager must not apply damage directly; damage policy is downstream of Ymir contact truth."
Assert-NotContains $hullCollider "OnCollisionEnter" "HullCollider must not mutate entity physics from Unity collision callbacks."
Assert-NotContains $hullCollider "SendHit(" "HullCollider must not expose a Unity-callback hit publisher as damage authority."
Assert-Contains $projectile "AetheriaYmirPhysicsBridge.Instance.TryStepProjectile" "Projectile travel and direct-hit discovery must route through the Ymir bridge."
Assert-Contains $projectile "projectile killed instead of falling back to Unity physics" "Projectile must fail closed when Ymir stepping is unavailable."
Assert-NotContains $projectile "OnCollisionEnter" "Projectile must not use Unity collision callbacks for hit discovery."
Assert-NotContains $projectile "Physics." "Projectile must not use UnityEngine.Physics as hit-discovery authority."
Assert-Contains $bridge "public bool EnableProjectileCutover = true;" "Ymir projectile cutover must be enabled by default."
Assert-Contains $bridge "YmirPhysicsQueries.Step(request)" "The Aetheria bridge must step projectiles through Ymir physics queries."
Assert-Contains $bridge "result.contacts" "The Aetheria bridge must derive projectile hits from Ymir contact events."
Assert-Contains $bridge "TryResolveTargetDaemonHull" "Ymir contact body ids must resolve to Aetheria hulls through the bridge seam."
$weaponAuthorityFiles = Get-ChildItem -LiteralPath (Join-Path $AetheriaRoot "Assets\Scripts\Gameplay\Weapons") -Filter "*.cs" -File
foreach ($file in $weaponAuthorityFiles) {
$text = Get-Content -Raw -LiteralPath $file.FullName
if ($text.Contains("Physics.")) {
throw "Weapon gameplay file still uses UnityEngine.Physics directly: $($file.FullName)"
}
}
Write-Host "Aetheria/Ymir cutover proof passed for $AetheriaRoot"