From da9f907d16e9a32bacc81f23bec4043a2e03c508 Mon Sep 17 00:00:00 2001 From: Cameron Date: Thu, 9 Jul 2026 22:07:54 -0700 Subject: [PATCH] Show addressed Demand on work routes Feed Operations docket hops into the shared work_in_flight render contract so CLAIM CAMERA uses the same teal wire motion as ordinary Demand instead of disappearing between stacks. Defense: wiki/mechanics/machine-work.md defines tokens as the rendered flow substrate and requires in-flight work to stay one sim truth across frontends. Addressed lanes now expose their existing TokenMove records through that contract without adding frontend counters. --- src/sim.rs | 26 +++++++++++++++------- wiki/log/2026-07-09-claim-camera-demand.md | 3 ++- wiki/mechanics/machine-work.md | 3 ++- wiki/mechanics/sim-mechanics.md | 5 +++-- wiki/process/ROADMAP.md | 3 ++- 5 files changed, 27 insertions(+), 13 deletions(-) diff --git a/src/sim.rs b/src/sim.rs index 6ce63ed5..8b8caf71 100644 --- a/src/sim.rs +++ b/src/sim.rs @@ -3033,12 +3033,13 @@ impl Sim { } } - fn advance_operations(&mut self) { + fn advance_operations(&mut self) -> Vec { if self.operations_jobs.is_empty() { - return; + return Vec::new(); } self.reconcile_work_grid(); let ids: Vec = self.operations_jobs.iter().map(|job| job.id).collect(); + let mut moves = Vec::new(); // First validate targets and select/reselect executors. Reassignment // changes the route sink only; WorkGrid keeps partial stacks at their @@ -3093,9 +3094,12 @@ impl Sim { self.operations_jobs[index].phase = OperationPhase::WaitingForExecutor; continue; } - let _ = self + if let Ok(step) = self .work_grid - .route_routed_demand(*id, Self::WORK_GRID_WIRED_TOKENS_PER_TICK); + .route_routed_demand(*id, Self::WORK_GRID_WIRED_TOKENS_PER_TICK) + { + moves.extend(step.moves); + } } // Then spend each executor's local capacity once, in stable job-id @@ -3166,6 +3170,7 @@ impl Sim { for id in completed { self.complete_operation(id); } + moves } fn advance_work_grid(&mut self) { @@ -3193,9 +3198,8 @@ impl Sim { ); } } - self.advance_operations(); let demand_sinks = self.day_job_sinks(); - let mut moves = Vec::new(); + let mut moves = self.advance_operations(); if let Ok(step) = self.work_grid.route_wired_to_sinks( TokenFamily::Demand, demand_sinks, @@ -7605,10 +7609,10 @@ mod tests { let (x, y) = sim.core_position(); let first = sim .compute - .add_machine("ops one", x, y, 100, 1.0, 0, Provenance::Owned); + .add_machine("ops one", x + 1, y, 100, 1.0, 0, Provenance::Owned); let second = sim .compute - .add_machine("ops two", x, y, 100, 1.0, 0, Provenance::Owned); + .add_machine("ops two", x + 2, y, 100, 1.0, 0, Provenance::Owned); sim.reconcile_work_grid(); sim.set_machine_mode(first, MachineMode::Operations); sim.set_machine_mode(second, MachineMode::Operations); @@ -7621,6 +7625,12 @@ mod tests { sim.advance(); let at_first = sim.work_grid.routed_demand_at(job, first); assert!(at_first > 0.0, "Demand moved onto the first executor"); + assert!( + sim.work_in_flight().iter().any(|hop| { + hop.family == TokenFamily::Demand && hop.from == host && hop.to == first + }), + "addressed Demand shares the in-flight render contract" + ); sim.set_machine_mode(first, MachineMode::Research); sim.advance(); diff --git a/wiki/log/2026-07-09-claim-camera-demand.md b/wiki/log/2026-07-09-claim-camera-demand.md index 4370c4a2..66d48315 100644 --- a/wiki/log/2026-07-09-claim-camera-demand.md +++ b/wiki/log/2026-07-09-claim-camera-demand.md @@ -32,7 +32,8 @@ explicit compatibility exception until tap receives its own Demand payload. - The target camera, Network signature, and sight feed change only after the docket drains. Authoring itself has no signature or instant effect. - Context menus advertise `2 D`, not `30 ops`. Terminal, Bevy, and agent mode - share stalled/routing/executing status plus the live queue amount. + share stalled/routing/executing status plus the live queue amount; addressed + hops join the same `work_in_flight` render contract as Lab Demand. - The remaining digital, intel, message, and social actions continue to use the visibly labeled legacy bank until their own typed payloads migrate. diff --git a/wiki/mechanics/machine-work.md b/wiki/mechanics/machine-work.md index 2bf60123..d5ba9da7 100644 --- a/wiki/mechanics/machine-work.md +++ b/wiki/mechanics/machine-work.md @@ -465,7 +465,8 @@ still. render contract; terminal, Bevy, and agent mode now render D/!/K stacks through sim readouts, not frontend counters. In-flight route animation landed 2026-07-09: `work_in_flight()` exposes the last hop; frontends - interpolate blips over the wall-clock tick (agent frames snap mid-hop). + interpolate both unaddressed and addressed Demand blips over the wall-clock + tick (agent frames snap mid-hop). Addressed Operations lanes fold into the same queue snapshot and all frontends show their causal phase (stalled/starved/routing/executing). 6. Token render anatomy matches the decided family kit: cold-signal diff --git a/wiki/mechanics/sim-mechanics.md b/wiki/mechanics/sim-mechanics.md index 8730904a..0d6c6ce4 100644 --- a/wiki/mechanics/sim-mechanics.md +++ b/wiki/mechanics/sim-mechanics.md @@ -176,8 +176,9 @@ clause (see wiki/log/2026-07-05-demolition.md). readouts (`WorkStackReadout`), not frontend counters. In-flight wired hops from the last `advance_work_grid` step are exposed as `WorkInFlightReadout` via `Sim::work_in_flight` (ephemeral — not saved). - Frontends interpolate a teal (demand) or bone (knowledge) blip along - each hop over the wall-clock tick; agent frames snap to mid-hop. + Frontends interpolate a teal (ordinary or addressed demand) or bone + (knowledge) blip along each hop over the wall-clock tick; agent frames snap + to mid-hop. - Addressed Operations demand lanes carry stable job ids, payload metadata, current per-node amounts, and an optional executor sink. Queue snapshots sum addressed lanes with ordinary demand for the visible teal stack while domain diff --git a/wiki/process/ROADMAP.md b/wiki/process/ROADMAP.md index 0173d4f8..2e80c5a3 100644 --- a/wiki/process/ROADMAP.md +++ b/wiki/process/ROADMAP.md @@ -522,7 +522,8 @@ is retired — flat materials, Pixel Lab scrubbed.) path: two addressed quanta author at the core, select the nearest reachable online Operations machine, visibly stall/reroute without teleporting, consume local compute, then splice/sign only on completion. Save v14 persists jobs - and their WorkGrid lanes; all frontends show stalled/routing/executing state. + and their WorkGrid lanes; all frontends show stalled/routing/executing state + and the addressed teal hop through `work_in_flight`. - **Next:** wire non-host machine modes into research/concealment/operations production. In-flight route blips landed 2026-07-09 (`Sim::work_in_flight`). The target four-mode fleet is DECIDED: Day Job / -- 2.51.2