diff --git a/aravath_runtime/src/combat.rs b/aravath_runtime/src/combat.rs index 6afc28ecd1..2144be9282 100644 --- a/aravath_runtime/src/combat.rs +++ b/aravath_runtime/src/combat.rs @@ -14,6 +14,19 @@ pub const ACTIVE: f32 = 0.14; pub const RECOVERY: f32 = 0.22; pub const SWORD_REACH: f32 = 1.8; pub const SWORD_DAMAGE: f32 = 25.0; + +/// `run_aravath_slice` builds an ECS app, parses the table, and ticks a destruction world. +/// Sword remainder and the cover bond are constant, so the greybox runs that once at startup. +pub fn prime_sword_slice() { + let _ = sword_hit(); +} + +fn sword_hit() -> (f32, bool) { + use std::sync::OnceLock; + static SLICE: OnceLock = OnceLock::new(); + let slice = SLICE.get_or_init(astraweave_weaving::run_aravath_slice); + (40.0 - slice.sword_hp as f32, !slice.cover_intact) +} pub const ENEMY_DAMAGE: f32 = 12.0; pub const HIT_REACT: f32 = 0.4; pub const ATTACK_WINDOW: f32 = STARTUP + ACTIVE + RECOVERY; @@ -159,7 +172,7 @@ pub struct Combat { pub enemies: Vec, pub lock: Option, pub hit_react: f32, - /// Set when a sword hit's `run_aravath_slice` breaks the cover bond. + /// Set when a sword hit breaks the cover bond from the startup slice. pub cover_broken: bool, } @@ -208,11 +221,10 @@ impl Combat { if was_active && !self.attack.hit_landed { if let Some(index) = sword_target(self, physics, player) { self.attack.hit_landed = true; - let slice = astraweave_weaving::run_aravath_slice(); - let dealt = 40.0 - slice.sword_hp as f32; + let (dealt, cover_broke) = sword_hit(); let enemy = &mut self.enemies[index]; enemy.health = (enemy.health - dealt).max(0.0); - if !slice.cover_intact { + if cover_broke { self.cover_broken = true; } enemy.stagger = 0.45; @@ -486,6 +498,18 @@ mod tests { assert!((combat.enemies[0].health - health).abs() < 0.01); } + #[test] + fn sword_hit_reads_the_startup_slice() { + let (dealt, cover_broke) = sword_hit(); + assert!( + (dealt - SWORD_DAMAGE).abs() < 0.01, + "startup slice remainder must stay the dealt damage" + ); + assert!(cover_broke, "the startup slice breaks the cover bond"); + let (again, _) = sword_hit(); + assert_eq!(again.to_bits(), dealt.to_bits()); + } + #[test] fn stagger_interrupts_approach() { let (mut physics, player, mut combat) = arena(); diff --git a/aravath_runtime/src/ground.rs b/aravath_runtime/src/ground.rs index e5b38bf808..8619373331 100644 --- a/aravath_runtime/src/ground.rs +++ b/aravath_runtime/src/ground.rs @@ -332,10 +332,34 @@ impl Ground { }); } + /// Command log that `dig_sphere` has applied. A checkpoint stores this beside the voxel edits. + pub fn demolition_log(&self) -> Vec { + self.demolition.persist_bytes() + } + /// Replace the edit log and rebuild every loaded chunk from the heightfield - /// plus that log. Used when a save is loaded. + /// plus that log. The demolition world is a fresh column seed. pub fn restore_edits(&mut self, edits: Vec) { + self.restore_dug(edits, &[]) + .expect("an empty demolition log is a fresh world"); + } + + /// Rebuild voxels from `edits` and the demolition command log. + /// An empty log starts a new column world. A log that does not restore is an error. + pub fn restore_dug(&mut self, edits: Vec, log: &[u8]) -> anyhow::Result<()> { self.edits = edits; + self.demolition = Box::new(if log.is_empty() { + column_demolition() + } else { + let mut world = DestructionWorld::restore(log) + .map_err(|err| anyhow::anyhow!("demolition log did not restore: {err:?}"))?; + world.bind_column_fns(ColumnFns { + top: column_gen::surface_height, + material: seed_column_material, + }); + world.reload_logged_brushes(); + world + }); let mut coords: Vec = self.generated.iter().copied().collect(); sort_coords(&mut coords); for coord in coords { @@ -343,6 +367,7 @@ impl Ground { fill_height_chunk(&mut self.grid, coord); self.reapply_edits(coord); } + Ok(()) } fn visible_props(&self, coord: ChunkCoord) -> Vec { diff --git a/aravath_runtime/src/main.rs b/aravath_runtime/src/main.rs index 8a7b3e7fde..de2ab68c4f 100644 --- a/aravath_runtime/src/main.rs +++ b/aravath_runtime/src/main.rs @@ -395,10 +395,16 @@ impl ApplicationHandler for App { let restore_uploads = if caught.steps > 0 && self.load_toggle { self.load_toggle = false; match aravath_runtime::save::load_checkpoint(&save_root()) { - Ok(checkpoint) => { - self.notice = Some(("Loaded".into(), 2.5)); - Some(self.sim.restore(checkpoint)) - } + Ok(checkpoint) => match self.sim.restore(checkpoint) { + Ok(uploads) => { + self.notice = Some(("Loaded".into(), 2.5)); + Some(uploads) + } + Err(err) => { + self.notice = Some((format!("Load failed: {err}"), 3.5)); + None + } + }, Err(err) => { self.notice = Some((format!("Load failed: {err}"), 3.5)); None diff --git a/aravath_runtime/src/save.rs b/aravath_runtime/src/save.rs index 0f7ec29890..adc214cc6b 100644 --- a/aravath_runtime/src/save.rs +++ b/aravath_runtime/src/save.rs @@ -14,6 +14,8 @@ use crate::ground::VoxelEdit; pub struct Checkpoint { pub edits: Vec, + /// `DestructionWorld::persist_bytes`. Empty on saves written before the brush log. + pub demolition: Vec, pub position: Vec3, pub yaw: f32, pub stamina: f32, @@ -25,6 +27,10 @@ pub fn save_checkpoint(root: &Path, checkpoint: &Checkpoint) -> Result<()> { let manager = SaveManager::new(root); let mut meta = std::collections::HashMap::new(); meta.insert("edits".into(), encode_edits(&checkpoint.edits)); + if checkpoint.demolition.len() > MAX_DEMOLITION { + bail!("demolition log is too long"); + } + meta.insert("demolition".into(), encode_hex(&checkpoint.demolition)); insert_into_meta(&mut meta, &checkpoint.scars).context("encode veil scars")?; meta.insert( "ground".into(), @@ -73,6 +79,18 @@ pub fn load_checkpoint(root: &Path) -> Result { .context("read aravath save")?; let edits_text = bundle.meta.get("edits").map(String::as_str).unwrap_or(""); let edits = decode_edits(edits_text)?; + let demolition = match bundle.meta.get("demolition").map(String::as_str) { + Some(text) if !text.is_empty() => { + let bytes = decode_hex(text).context("demolition log")?; + if bytes.len() > MAX_DEMOLITION { + bail!("demolition log is too long"); + } + astraweave_destruction::DestructionWorld::restore(&bytes) + .map_err(|err| anyhow::anyhow!("demolition log did not restore: {err:?}"))?; + bytes + } + _ => Vec::new(), + }; let player = bundle .meta .get("player") @@ -96,6 +114,7 @@ pub fn load_checkpoint(root: &Path) -> Result { let scars = read_from_meta(&bundle.meta).context("decode veil scars")?; Ok(Checkpoint { edits, + demolition, position, yaw, stamina, @@ -105,6 +124,7 @@ pub fn load_checkpoint(root: &Path) -> Result { } const MAX_EDITS: usize = 16_384; +const MAX_DEMOLITION: usize = 1024 * 1024; const MAX_EDIT_COORD: i32 = 2_048; const MAX_EDIT_TEXT: usize = 2 * 1024 * 1024; @@ -269,6 +289,7 @@ mod tests { dir.path(), &Checkpoint { edits: ground.edits.clone(), + demolition: Vec::new(), position, yaw: 0.4, stamina: 77.0, @@ -317,6 +338,7 @@ mod tests { dir.path(), &Checkpoint { edits: Vec::new(), + demolition: Vec::new(), position: Vec3::new(1.0, 2.0, 3.0), yaw: 0.0, stamina: 1.0, @@ -361,6 +383,7 @@ mod tests { dir.path(), &Checkpoint { edits: Vec::new(), + demolition: Vec::new(), position: Vec3::ZERO, yaw: 0.0, stamina: 1.0, diff --git a/aravath_runtime/src/sim.rs b/aravath_runtime/src/sim.rs index d6915a2f1c..a45245773f 100644 --- a/aravath_runtime/src/sim.rs +++ b/aravath_runtime/src/sim.rs @@ -123,6 +123,7 @@ pub struct Greybox { impl Greybox { pub fn new(grid: VoxelGrid, spawn: Vec3) -> Self { + crate::combat::prime_sword_slice(); let mut physics = PhysicsWorld::new(Vec3::new(0.0, -9.81, 0.0)); let mut ground = Ground::from_grid(grid); let initial_uploads = ground.sync_dirty(&mut physics); @@ -153,6 +154,7 @@ impl Greybox { } pub fn open(radius: i32) -> Self { + crate::combat::prime_sword_slice(); let spawn = Vec3::new(16.0, 20.0, 16.0); let mut physics = PhysicsWorld::new(Vec3::new(0.0, -9.81, 0.0)); let mut ground = Ground::from_grid(VoxelGrid::new()); @@ -458,6 +460,7 @@ impl Greybox { pub fn checkpoint(&self) -> crate::save::Checkpoint { crate::save::Checkpoint { edits: self.ground.edits.clone(), + demolition: self.ground.demolition_log(), position: self.player_pos(), yaw: self.player.facing_yaw, stamina: self.motor.stamina, @@ -466,7 +469,10 @@ impl Greybox { } } - pub fn restore(&mut self, checkpoint: crate::save::Checkpoint) -> Vec { + pub fn restore( + &mut self, + checkpoint: crate::save::Checkpoint, + ) -> anyhow::Result> { self.motor.stamina = checkpoint.stamina.clamp(0.0, self.motor.stamina_max); self.combat.player_hp = checkpoint.player_hp.max(0.0); self.player.facing_yaw = checkpoint.yaw; @@ -474,10 +480,11 @@ impl Greybox { self.physics .set_body_position(self.player.body, checkpoint.position); self.camera.pivot = checkpoint.position; - self.ground.restore_edits(checkpoint.edits); + self.ground + .restore_dug(checkpoint.edits, &checkpoint.demolition)?; let uploads = self.ground.sync_dirty(&mut self.physics); self.physics.step(); - uploads + Ok(uploads) } /// Full health at the original spawn. The edit log stays. @@ -802,7 +809,7 @@ mod tests { sim.ground.dig_sphere(Vec3::new(20.0, 4.0, 16.0), 1.0); sim.combat.player_hp = 0.0; let loaded = crate::save::load_checkpoint(dir.path()).unwrap(); - let _ = sim.restore(loaded); + sim.restore(loaded).unwrap(); assert!((sim.combat.player_hp - 41.0).abs() < 1e-3); assert!((sim.motor.stamina - 18.0).abs() < 1e-3); assert!((sim.player.facing_yaw - 0.7).abs() < 1e-3); @@ -1006,11 +1013,41 @@ mod tests { let mut restored_a = Greybox::open(0); let mut restored_b = Greybox::open(0); - let _ = restored_a.restore(crate::save::load_checkpoint(dir.path()).unwrap()); - let _ = restored_b.restore(crate::save::load_checkpoint(dir.path()).unwrap()); + restored_a + .restore(crate::save::load_checkpoint(dir.path()).unwrap()) + .unwrap(); + restored_b + .restore(crate::save::load_checkpoint(dir.path()).unwrap()) + .unwrap(); assert_eq!(restored_a.state_hash(), restored_b.state_hash()); } + #[test] + fn dig_after_load_matches_the_continuous_run() { + let dig_at = |sim: &mut Greybox, x: i32, z: i32| { + let y = crate::island::surface_height(x, z) as f32; + sim.ground.dig_sphere(Vec3::new(x as f32, y, z as f32), 1.5); + let _ = sim.ground.sync_dirty(&mut sim.physics); + }; + let mut live = Greybox::open(0); + dig_at(&mut live, 16, 16); + live.physics.step(); + dig_at(&mut live, 18, 16); + let expected = live.state_hash(); + + let mut saved = Greybox::open(0); + dig_at(&mut saved, 16, 16); + let dir = tempfile::tempdir().unwrap(); + crate::save::save_checkpoint(dir.path(), &saved.checkpoint()).unwrap(); + let mut loaded = Greybox::open(0); + loaded + .restore(crate::save::load_checkpoint(dir.path()).unwrap()) + .unwrap(); + dig_at(&mut loaded, 18, 16); + assert_eq!(loaded.ground.edits.len(), live.ground.edits.len()); + assert_eq!(loaded.state_hash(), expected); + } + #[test] fn frame_schedule_does_not_change_fixed_ticks() { let held = TickInput { @@ -1134,7 +1171,7 @@ mod tests { crate::save::save_checkpoint(dir.path(), &sim.checkpoint()).unwrap(); sim.scars = astraweave_veil::ScarField::new(); let loaded = crate::save::load_checkpoint(dir.path()).unwrap(); - let _ = sim.restore(loaded); + sim.restore(loaded).unwrap(); assert_eq!(sim.scars.state_hash(), hash); } } diff --git a/astraweave-destruction/src/lib.rs b/astraweave-destruction/src/lib.rs index 77172f7494..893bc23f35 100644 --- a/astraweave-destruction/src/lib.rs +++ b/astraweave-destruction/src/lib.rs @@ -205,13 +205,9 @@ impl DestructionWorld { self.terrain.set_column_fns(fns); } - /// Load the brush chunk, record the command, and apply it on this tick. + /// Load every chunk the brush can touch, record the command, and apply it on this tick. pub fn apply_brush_now(&mut self, brush: crate::command::Brush) -> Result<(), CommandError> { - let chunk = ( - brush.origin[0].div_euclid(crate::octree::CHUNK_EXTENT), - brush.origin[2].div_euclid(crate::octree::CHUNK_EXTENT), - ); - self.terrain.load(chunk); + self.load_brush_chunks(brush); self.enqueue(DestructionCommand { tick: self.tick, seq: 0, @@ -222,6 +218,40 @@ impl DestructionWorld { Ok(()) } + /// Load chunks already in the log. A restored world only has chunk `(0, 0)` until this runs. + pub fn reload_logged_brushes(&mut self) { + let count = self.log.len(); + for index in 0..count { + if let CommandKind::Brush(brush) = self.log[index].kind { + self.load_brush_chunks(brush); + } + } + } + + fn load_brush_chunks(&mut self, brush: crate::command::Brush) { + let extent = crate::octree::CHUNK_EXTENT; + let radius = i32::from(brush.radius); + let x0 = brush.origin[0].saturating_sub(radius).div_euclid(extent); + let x1 = brush.origin[0].saturating_add(radius).div_euclid(extent); + let z0 = brush.origin[2].saturating_sub(radius).div_euclid(extent); + let z1 = brush.origin[2].saturating_add(radius).div_euclid(extent); + let mut x = x0; + loop { + let mut z = z0; + loop { + self.terrain.load((x, z)); + if z == z1 { + break; + } + z += 1; + } + if x == x1 { + break; + } + x += 1; + } + } + pub fn debris(&self) -> &DebrisPool { &self.debris } @@ -986,6 +1016,26 @@ mod tests { use super::*; use debris::DebrisLod; + #[test] + fn brush_across_a_chunk_border_lowers_both_columns() { + let mut world = DestructionWorld::new(1, 6); + let brush = Brush { + shape: BrushShape::Sphere, + op: BrushOp::Subtract, + origin: [31, 2, 4], + radius: 3, + half_extents: [1, 1, 1], + strength: 4, + }; + world.apply_brush_now(brush).expect("brush"); + assert!(world.terrain().surface_y(31, 4) < 6); + assert!( + world.terrain().surface_y(32, 4) < 6, + "the dig must cross into the next chunk" + ); + assert_eq!(world.terrain().surface_y(0, 0), 6); + } + #[test] fn collapse_notice_covers_the_dropped_bridge_span() { let mut world = DestructionWorld::new(9, 0); diff --git a/docs/architecture/combat.md b/docs/architecture/combat.md index dcc01245b2..889019cb76 100644 --- a/docs/architecture/combat.md +++ b/docs/architecture/combat.md @@ -9,8 +9,8 @@ lifecycle_status: active integration_status: partial summary: "Cover hits enqueue destruction impacts. The greybox sword hit calls run_aravath_slice and can show Cover broke. Fixed64 is astraweave-math." owns: [astraweave-combat] -doc_version: "1.4" -last_verified_commit: d6903d3a +doc_version: "1.5" +last_verified_commit: 7a5fd4f6 runtime_edges: - to: astraweave-ecs note: CombatPlugin registers combat_resolve_system on the simulation stage @@ -26,10 +26,10 @@ runtime_edges: |---|---| | **System name** | Combat damage | | **Primary crates** | `astraweave-combat` | -| **Document version** | 1.4 | -| **Last verified against commit** | `d6903d3a` | +| **Document version** | 1.5 | +| **Last verified against commit** | `7a5fd4f6` | | **Last verified date** | 2026-10-16 | -| **Status** | Active, partial. A connecting greybox sword hit calls `run_aravath_slice` (#275). The window shows `Cover broke` once when that slice breaks the cover bond. Shield, roll, and scar injection stay in `aravath_runtime`. | +| **Status** | Active, partial. A connecting greybox sword hit uses the `sword_hp` from one `run_aravath_slice` at startup (#275). The window shows `Cover broke` once when that slice breaks the cover bond. Shield, roll, and scar injection stay in `aravath_runtime`. | | **Owner notes** | Formula spec: `docs/current/COMBAT_DAMAGE_SYSTEM_DESIGN.md`. Gate Pass, 2026-10-14. | --- @@ -166,7 +166,7 @@ CVitals.hp / poise ecs.rs apply_hp_delta ## 11. Open Questions / Parked Decisions -- The greybox sword hit calls `run_aravath_slice` (#275, `cc2b6c20`). Dealt damage is `40 - sword_hp`. The slice test locks the remainder at 15, so the hit deals 25. `cover_intact == false` sets `cover_broken`, and `aravath_runtime` shows `Cover broke` once for 2.5 seconds. Shield, roll, and scar injection still live in `aravath_runtime`. +- The greybox sword hit uses `sword_hp` from one `run_aravath_slice` at `Greybox` startup (#275). A later hit does not build another app. Dealt damage is `40 - sword_hp`. The slice test locks the remainder at 15, so the hit deals 25. `cover_intact == false` sets `cover_broken`, and `aravath_runtime` shows `Cover broke` once for 2.5 seconds. Shield, roll, and scar injection still live in `aravath_runtime`. - `WorldSnapshot` does not grow an EHP field until planner hashes are versioned. - Raising the 8-modifier ceiling needs a new overflow proof. @@ -181,3 +181,4 @@ CVitals.hp / poise ecs.rs apply_hp_delta | Version | Date | Change | |---|---|---| | 1.4 | 2026-10-16 | Greybox sword hit calls `run_aravath_slice`. The window notice is `Cover broke`. | +| 1.5 | 2026-10-16 | The greybox runs `run_aravath_slice` once at startup. Each sword hit applies that cached remainder. | diff --git a/docs/architecture/destruction.md b/docs/architecture/destruction.md index 614062cdbb..0f7e75898d 100644 --- a/docs/architecture/destruction.md +++ b/docs/architecture/destruction.md @@ -9,8 +9,8 @@ lifecycle_status: active integration_status: wired summary: "Greybox digs with a sphere Subtract brush on ColumnFns. FlatColumnBase keeps the destruction replay hash." owns: [astraweave-destruction] -doc_version: "1.4" -last_verified_commit: 84d3888a +doc_version: "1.5" +last_verified_commit: 7a5fd4f6 runtime_edges: - to: astraweave-core note: "The core replay test calls demolition_bytes." @@ -26,10 +26,10 @@ runtime_edges: |---|---| | **System name** | Deterministic destruction | | **Primary crates** | `astraweave-destruction` | -| **Document version** | 1.4 | -| **Last verified against commit** | `84d3888a` | +| **Document version** | 1.5 | +| **Last verified against commit** | `7a5fd4f6` | | **Last verified date** | 2026-10-16 | -| **Status** | Active. Headless showcase and the required replay case. The Aravath greybox binds integer columns through `ColumnFns` and digs with a sphere `Subtract` brush. `Greybox::step` calls `BridgeAgent::step` after the motor. `FlatColumnBase` remains the terrain when no functions are bound, so the `destruction` replay hash is unchanged. The greybox golden is `b6a9d5a2c5da28a6` (#330). The earlier #329 value was `0a576578512f25d2`. | +| **Status** | Active. Headless showcase and the required replay case. The Aravath greybox binds integer columns through `ColumnFns` and digs with a sphere `Subtract` brush. `Greybox::step` calls `BridgeAgent::step` after the motor. `apply_brush_now` loads every chunk in `(origin ± radius) / CHUNK_EXTENT` before the tick. A checkpoint stores `persist_bytes` and `restore_dug` replays that log before the next dig. `FlatColumnBase` remains the terrain when no functions are bound, so the `destruction` replay hash is unchanged. The greybox golden is `b6a9d5a2c5da28a6` (#330). The earlier #329 value was `0a576578512f25d2`. | | **Owner notes** | Design: `docs/current/DESTRUCTION_DESIGN.md`. Survey: `docs/current/DESTRUCTION_ARCHAEOLOGY.md`. `Fixed64` lives in `astraweave-math` (PR #245). | --- @@ -124,7 +124,7 @@ Floats do not enter this pipeline. Rapier is not called. |---|---|---| | `astraweave-physics` `DestructionManager` | Dormant float toy | Left in place. New calls do not go through it | | `PhysicsWorld::add_destructible_box` | Stub | Not extended | -| Greybox `dig_sphere` | Calls `apply_brush_now` | Sphere `Subtract` brush, then the island mesh is carved by `seed - surface_y`. A full command log returns before that carve | +| Greybox `dig_sphere` | Calls `apply_brush_now` | Sphere `Subtract` brush. Every chunk the radius touches is loaded before `tick`. The island mesh is carved by `seed - surface_y`. A checkpoint replays `persist_bytes` on load. A full command log returns before that carve | | #215 `surface_height` | Bound by the greybox | `column_gen` stays in `astraweave-terrain`. `ColumnFns` is the hook. `FlatColumnBase` stays for the replay case | --- @@ -204,3 +204,4 @@ Update this trace when the command set, the stress iteration count, the pool siz | 1.2 | 2026-10-15 | Collapse notices publish the union of newly dynamic piece bounds. Issue #279 | | 1.4 | 2026-10-16 | Merge `84d3888a`. `Greybox::step` calls `BridgeAgent`. Greybox golden is `0a576578512f25d2`. #249, #250, and #261 are still open on the tracker. | | 1.3 | 2026-10-16 | `ColumnFns` and `apply_brush_now`. Greybox digs with a brush. `FlatColumnBase` stays the unbound terrain. Issues #249 and #250 | +| 1.5 | 2026-10-16 | `apply_brush_now` loads the brush span, not only the centre chunk. Greybox save stores the command log and replays it on restore. The `destruction` replay case and the greybox golden are unchanged. | diff --git a/docs/architecture/weaving.md b/docs/architecture/weaving.md index 59f936857f..420cc4fd2f 100644 --- a/docs/architecture/weaving.md +++ b/docs/architecture/weaving.md @@ -10,7 +10,7 @@ integration_status: partial summary: "weave_tick is on main (#252). The greybox sword hit calls run_aravath_slice (#275). Required replay case weaving hashes NullField until local sim #253." owns: [astraweave-weaving] doc_version: "1.7" -last_verified_commit: 1e275a9e +last_verified_commit: 7a5fd4f6 --- # Architecture Trace: Weaving / Fate-Weaving System (`astraweave-weaving`) @@ -22,7 +22,7 @@ last_verified_commit: 1e275a9e | **System name** | Weaving / Fate-Weaving System (the Veilweaver signature mechanic) | | **Primary crates** | `astraweave-weaving` | | **Document version** | 1.7 | -| **Last verified against commit** | `1e275a9e` | +| **Last verified against commit** | `7a5fd4f6` | | **Last verified date** | 2026-10-16 | | **Status** | The data-driven cast path is on main (#252). A connecting greybox sword hit calls `run_aravath_slice` (#275). Required replay case `weaving`. `NullField` stands in for the local sim (#253). Anchor-slice helpers are still plain functions. | | **Owner notes** | Built during the Veilweaver vertical-slice "Weeks 1-5" campaign (see `docs/journey/weeks/WEEK_*` and `docs/archive/projects/veilweaver/`). Naming is heavily overloaded across three independent "weaving" surfaces in the workspace — see §3 and §6. | @@ -237,7 +237,7 @@ This crate hosts **two distinct pipelines** that do not call each other. Both ar | File | Role | Status | Notes | |---|---|---|---| | [`lib.rs`](../../astraweave-weaving/src/lib.rs) | Module roots, re-exports, `CWeaveAgent`/`CWeaveSignal`/`WeaveIntentEvent` ECS-style components | Active | `#![forbid(unsafe_code)]`. | -| [`aravath.rs`](../../astraweave-weaving/src/aravath.rs) | `run_aravath_slice`, `ARAVATH_SLICE_SEED` (`0xA11C_E5EE`) | Active | One combat resolve plus one destruction tick. Sword hp 15, weave hp 25, cover bond broken. `aravath_runtime` `Combat::tick` calls it on a connecting sword hit (#275). | +| [`aravath.rs`](../../astraweave-weaving/src/aravath.rs) | `run_aravath_slice`, `ARAVATH_SLICE_SEED` (`0xA11C_E5EE`) | Active | One combat resolve plus one destruction tick. Sword hp 15, weave hp 25, cover bond broken. `Greybox::new` and `Greybox::open` call it once. A sword hit reads that remainder (#275). | | [`gameplay_qa.rs`](../../astraweave-weaving/src/gameplay_qa.rs) | Scenario loader, scripted and goal policies, failure artifact, ddmin | Active | Scenario 1 calls `run_aravath_slice` once per trace. It does not split the function. | | [`scenarios/aravath_slice_sword.ron`](../../astraweave-weaving/scenarios/aravath_slice_sword.ron) | Scenario 1 | Active | Reach check only. `SaveReload` and `SameSeqTwice` are not in this file. | | [`mod_queue.rs`](../../astraweave-weaving/src/mod_queue.rs) | `queue_weave`, `parse_template_toml`, fixed `WeaveScratch` | Active | Sandbox host entry. Engine template ids 1 through 7 are reserved. The tick copies casts into a fixed array and does not evaluate a field. | @@ -430,6 +430,7 @@ This is a pure-CPU logic crate; performance is benchmark-tracked but not a runti |---|---|---| | 1.7 | 2026-10-16 | Restamp `1e275a9e`. Cargo consumers are the greybox, gameplay, scripting, security, the core replay test, `aravath_weave`, and the two older quest examples. | | 1.6 | 2026-10-16 | Greybox caller. `Combat::tick` calls `run_aravath_slice` and the window shows `Cover broke` when `cover_intact` is false. | +| 1.7 | 2026-10-16 | The greybox calls `run_aravath_slice` once at startup. Sword hits reuse `sword_hp` and `cover_intact`. | | 1.3 | 2026-10-15 | Scenario 1 gameplay QA. File map rows for `aravath.rs`, `gameplay_qa.rs`, and the RON. Invariant 11. | **Update this doc when:**