From ecfc78f410c61fa9f496fbea146bb62baca1748b Mon Sep 17 00:00:00 2001 From: Jan Petykiewicz Date: Sat, 18 Apr 2026 02:00:55 -0700 Subject: [PATCH] Carry annual stock capital service counters --- README.md | 3 ++- crates/rrt-runtime/src/import.rs | 2 ++ crates/rrt-runtime/src/runtime.rs | 4 ++++ crates/rrt-runtime/src/step.rs | 23 +++++++++++++++++++++++ crates/rrt-runtime/src/summary.rs | 8 ++++++++ docs/README.md | 3 ++- docs/runtime-rehost-plan.md | 3 ++- 7 files changed, 43 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index f5df3b2..a178693 100644 --- a/README.md +++ b/README.md @@ -106,7 +106,8 @@ full annual dividend adjustment branch over owned current cash, public float, cu building-growth policy, and recent profit history instead of leaving that policy on shell-side dialog notes. The same periodic service now also carries the annual bond lane's retired-versus- issued principal totals as first-class runtime summary state, which is the owner seam behind the -later debt-news family. `simulation_service_periodic_boundary_work` is now beginning to use that same owner +later debt-news family, and it now carries the paired issued-share and repurchased-share counts +behind the equity-offering and `2887` buyback news tails too. `simulation_service_periodic_boundary_work` is now beginning to use that same owner surface too: the runtime chooses one annual-finance action per active company and already commits the shellless creditor-pressure-bankruptcy, deep-distress-bankruptcy, dividend-adjustment, stock-repurchase, stock-issue, and bond-issue branches by mutating owned company activity, diff --git a/crates/rrt-runtime/src/import.rs b/crates/rrt-runtime/src/import.rs index d15f02d..172b7c2 100644 --- a/crates/rrt-runtime/src/import.rs +++ b/crates/rrt-runtime/src/import.rs @@ -13995,6 +13995,8 @@ mod tests { annual_dividend_adjustment_commit_count: 0, annual_bond_last_retired_principal_total: 0, annual_bond_last_issued_principal_total: 0, + annual_stock_repurchase_last_share_count: 0, + annual_stock_issue_last_share_count: 0, chairman_issue_opinion_terms_raw_i32: BTreeMap::new(), chairman_personality_raw_u8: BTreeMap::new(), }, diff --git a/crates/rrt-runtime/src/runtime.rs b/crates/rrt-runtime/src/runtime.rs index 21249a2..d29b8be 100644 --- a/crates/rrt-runtime/src/runtime.rs +++ b/crates/rrt-runtime/src/runtime.rs @@ -1241,6 +1241,10 @@ pub struct RuntimeServiceState { #[serde(default)] pub annual_bond_last_issued_principal_total: u64, #[serde(default)] + pub annual_stock_repurchase_last_share_count: u64, + #[serde(default)] + pub annual_stock_issue_last_share_count: u64, + #[serde(default)] pub chairman_issue_opinion_terms_raw_i32: BTreeMap>, #[serde(default)] pub chairman_personality_raw_u8: BTreeMap, diff --git a/crates/rrt-runtime/src/step.rs b/crates/rrt-runtime/src/step.rs index 73490c7..47e7669 100644 --- a/crates/rrt-runtime/src/step.rs +++ b/crates/rrt-runtime/src/step.rs @@ -502,6 +502,8 @@ fn service_company_annual_finance_policy( state.service_state.annual_finance_service_calls += 1; state.service_state.annual_bond_last_retired_principal_total = 0; state.service_state.annual_bond_last_issued_principal_total = 0; + state.service_state.annual_stock_repurchase_last_share_count = 0; + state.service_state.annual_stock_issue_last_share_count = 0; let mut mutated_company_ids = BTreeSet::new(); let mut applied_effect_count = 0u32; @@ -605,6 +607,10 @@ fn service_company_annual_finance_policy( proceeds_per_tranche as f64, false, ); + state.service_state.annual_stock_issue_last_share_count = state + .service_state + .annual_stock_issue_last_share_count + .saturating_add(u64::from(batch_size)); } let Some(market_state) = state .service_state @@ -838,6 +844,10 @@ fn service_company_annual_finance_policy( break; }; market_state.outstanding_shares = next_outstanding_shares; + state.service_state.annual_stock_repurchase_last_share_count = state + .service_state + .annual_stock_repurchase_last_share_count + .saturating_add(u64::from(batch_size)); } if mutated { applied_effect_count += 1; @@ -2899,6 +2909,14 @@ mod tests { state.service_state.annual_finance_last_actions.get(&22), Some(&crate::RuntimeCompanyAnnualFinancePolicyAction::StockIssue) ); + assert_eq!( + state.service_state.annual_stock_issue_last_share_count, + 4_000 + ); + assert_eq!( + state.service_state.annual_stock_repurchase_last_share_count, + 0 + ); assert_eq!(state.companies[0].current_cash, 390_000); assert_eq!( state.service_state.company_market_state[&22].outstanding_shares, @@ -3059,6 +3077,11 @@ mod tests { state.service_state.annual_finance_last_actions.get(&23), Some(&crate::RuntimeCompanyAnnualFinancePolicyAction::StockRepurchase) ); + assert_eq!(state.service_state.annual_stock_issue_last_share_count, 0); + assert_eq!( + state.service_state.annual_stock_repurchase_last_share_count, + 1_000 + ); assert_eq!( state.companies[0].current_cash, 1_600_000 - expected_repurchase_total diff --git a/crates/rrt-runtime/src/summary.rs b/crates/rrt-runtime/src/summary.rs index bb2d4df..03350b3 100644 --- a/crates/rrt-runtime/src/summary.rs +++ b/crates/rrt-runtime/src/summary.rs @@ -261,6 +261,8 @@ pub struct RuntimeSummary { pub annual_dividend_adjustment_commit_count: u64, pub annual_bond_last_retired_principal_total: u64, pub annual_bond_last_issued_principal_total: u64, + pub annual_stock_repurchase_last_share_count: u64, + pub annual_stock_issue_last_share_count: u64, pub total_trigger_dispatch_count: u64, pub dirty_rerun_count: u64, pub total_company_cash: i64, @@ -1389,6 +1391,12 @@ impl RuntimeSummary { annual_bond_last_issued_principal_total: state .service_state .annual_bond_last_issued_principal_total, + annual_stock_repurchase_last_share_count: state + .service_state + .annual_stock_repurchase_last_share_count, + annual_stock_issue_last_share_count: state + .service_state + .annual_stock_issue_last_share_count, total_trigger_dispatch_count: state .service_state .trigger_dispatch_counts diff --git a/docs/README.md b/docs/README.md index 8e6bfcc..a65b621 100644 --- a/docs/README.md +++ b/docs/README.md @@ -157,7 +157,8 @@ The highest-value next passes are now: directly from owned bond slots, and now also commits the shellless “repay matured live bonds, compact the table, then issue the exact staged count” path during periodic service; the same service surface now also carries the per-cycle retired-versus-issued principal totals that feed - the later debt-news family + the later debt-news family plus the issued-share and repurchased-share counts behind the later + equity-offering and buyback news tails - the project rule on the remaining closure work is now explicit too: when one runtime-facing field is still ambiguous, prefer rehosting the owning source state or real reader/setter family first instead of guessing another derived leaf field from neighboring raw offsets diff --git a/docs/runtime-rehost-plan.md b/docs/runtime-rehost-plan.md index c2a3bb6..1a6db6d 100644 --- a/docs/runtime-rehost-plan.md +++ b/docs/runtime-rehost-plan.md @@ -236,7 +236,8 @@ The annual bond lane now rides it as well, using the simulated post-repayment ca linked-transit threshold split to stage `500000` principal issue counts without shell ownership, and periodic boundary service now commits the same shellless matured-bond repay/compact/issue path instead of stopping at the staging reader. That same service seam now also carries the retired-versus-issued -principal totals needed by the later debt-news tail. +principal totals needed by the later debt-news tail, plus the issued-share and repurchased-share +counts needed by the later equity-offering and buyback news tails. The annual dividend-adjustment lane now rides that same seam too: the runtime now rehosts the shared year-or-control-transfer metric reader, the board-approved dividend ceiling helper, and the full annual dividend branch over owned cash, public float, current dividend, and building-growth